Given a section of HTML, can I selectively pick some types of elements (e.g., input) and add a custom attribute using JavaScript? I would also need to remove this attribute if i
Accessing HTML attributes using the DOM
element.hasAttribute('foo'); element.getAttribute('foo'); element.setAttribute('foo', value); element.removeAttribute('foo');