Is setAttribute deprecated?

In the documentation for DOM, setAttribute(Element, String, String) is deprecated , saying to use “the more appropriately named setElementProperty(Element, String, String) instead.” Does that imply that one should be using the similarly named methods of Element ?

Read more

How do I find an element ID?

getElementById() The Document method getElementById() returns an Element object representing the element whose id property matches the specified string. Since element IDs are required to be unique if specified, they’re a useful way to get access to a specific element quickly.

Read more