How to get the id for all the 'input' tags in HTML using JavaScript

1 Answer

0 votes
var inputs = document.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) 
{
    alert(inputs[i].id);
}


answered May 11, 2015 by avibootz
...