Reputation: 267000
The following jquery code works in firefox, but is returning undefined in IE:
$('someObject').attr("id")[0]
Why is that?
Upvotes: 0
Views: 196
Reputation: 121314
Try
$('someObject').attr("id").charAt(0)
The [] indexer operator is not supported on strings in Internet Explorer. string::charAt() is the correct method to use.
Upvotes: 10