hej
jag har använt följande kod på en massa ställen:
if(x[i].hasAttribute('class')){
jag trodde att jag testat det i gamla IE men det hade jag visst inte. Nu undrar jag om man kan få även de webläsare som inte stöder hasAttribute att förstå koden.
Jag tänkte något liknande:
Get the align attribute object of node x. If the node has no align attribute, it returns undefined (except in IE, where it returns an attribute object that has no value.)
hur bör koden se ut då för att även upptäcka internet explorers no value? så här:
if (x[i].attributes('class')!='undefined' || x[i].attributes('class')!=null){
eller kanske:
if (x[i].attributes('class')!='undefined' || x[i].attributes('class')!=''){