Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function myGetNameFunction() {
- var x = document.getElementsByTagName("input");
- console.log("x: " + x);
- console.log("Number of inputs: " + x.length);
- var arrayOfInputNames = [];
- for (var i = 0; i < x.length; i++) {
- console.log("i: " + i);
- console.log("value: " + x[i].name);
- arrayOfInputNames.push(x[i].name);
- }
- console.log(arrayOfInputNames);
- }
- myGetNameFunction();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement