I have written a jQuery code to get an attribute from a TR tag in html. The code works in IE 8, but when I run that in IE 9 I get a error “Function expected”. The code is below:
$(".grid tr").each(function () {
//I've inserted an attribute called idRow in each grid row.
if(this.attributes("idRow") != null) //I get the "Function expected error" here
{
...
}
});
What’s the code problem? Why it works in IE 8?
To take that approach, you’d need…
or…
…although, I’d suggest simply using
getAttribute().