JavaScript
x
4
1
function getInputElements() {
2
var inputs = document.getElementsByTagName("input");
3
}
4
The above code gets all the input
elements on a page which has more than one form. How do I get the input
elements of a particular form using plain JavaScript?
Advertisement
Answer
JavaScript
1
2
1
document.forms["form_name"].getElementsByTagName("input");
2