Which of the following can be used to select HTML elements based on the value of their name attributes?

Which of the following can be used to select HTML elements based on the value of their name attributes? Correct Answer getElementsByName()

The getElementsByName() method returns a collection of all elements in the document with the specified name (the value of the name attribute), as a NodeList object. var radiobuttons = document.getElementsByName("favorite_color");

Related Questions

What is the reason for avoiding the attributes property in the HTML DOM?