I am trying to remove attributes of a DOM element using below statement in javascript.
var res = nodes.removeAttribute("style");
but the res is always “undefined” it seems that the removeAttribute function does not return anything (I tested it on firefox browser)
How can I identify that the attribute is successfully removed or not ?
Thanks,
Sourabh
nodes? It seems that you have an array ofnodes. Anyway,removeAttributewill not return anything. To check if the attribute has been removed, usehasAttributeafterwards.