DOM change

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

DOM change

Rajat Gogri
Hello all,

I want to add some new unique attribute to all nodes of DOM from
Mozilla Engine. Could any one please tell me where in mozilla DOM gets
created and we can add one more attribute in all nodes.


Thanks and Regards,
Rajat
_______________________________________________
dev-tech-dom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-dom
Reply | Threaded
Open this post in threaded view
|

Re: DOM change

stony_dreams
Rajat Gogri wrote
I want to add some new unique attribute to all nodes of DOM from
Mozilla Engine. Could any one please tell me where in mozilla DOM gets
created and we can add one more attribute in all nodes.
You can access the dom of the currently loaded webpage in mozilla using content.document.documentElement

this would give you the root element. You can use a normal DFS to traverse the nodes and use the element.setAttribute to add attributes to the elements...