Could someone tell me how to write a function: getElementsWithAttributeName("attr-name")
?
It should return all elements from the current document
that contain the attribute attr-name
.
Also, how do I add this function to the document as well?
Any response will be much appreciated.