Node Attributes [] an array giving additional attributes in IE

I use "node.attributes" to retrieve all the DOM node attributes using JavaScript in IE. This gives me additional attributes that are not specified in the source. In Firefox, it only gives those specified in the HTML source (which is expected).

Is there a way to get the “only attributes” of the DOM elements that are specified in its HTML source in IE?

Thanks in advance.

-Sourabh

+3
source share
1 answer

Attributes have a property specifiedthat true, if the attribute was specified in the HTML source or explicitly specified by the script.

+6
source

Source: https://habr.com/ru/post/1714294/


All Articles