When i use
alert(j(this).attr("id"));
I can see the pop up window shows up _denominations[3].id.denominationId
but when i call
alert(j('#_denominations[3].id.denominationId').attr("id"));
The pop up window shows me 'undefined', the actual html DOM is looks like this:
<div class="form-field">
<select id="_denominations[3].id.denominationId" class="removableDenom" name="denominations[3].id.denominationId">
</div>
So what chance could possibly make undefined pop up happens
Try escaping the periods and brackets in the ID value itself. So your value:
'#_denominations[3].id.denominationId'
Becomes
'#_denominations\\[3\\]\\.id\\.denominationId'
It's likely that jQuery is confusing these with classes and attribute selectors.
Example: http://jsfiddle.net/jonathansampson/ZUMna/
you need to escape the special characters in ID..that is [,],..... since jquery takes [] as attribute selector and . as class selector..
try this
alert(j('#_denominations\\[3\\]\\.id\\.denominationId').attr("id"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With