Advertisement
matthewpoer

Show all Hidden Inputs on a Single Page (JavaScript)

Jul 17th, 2012
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // gather ALL the inputs
  2. var inputs = document.getElementsByTagName("input");
  3. for (x in inputs){
  4.     if(typeof inputs[x] != 'object'){
  5.         // if it wasn't actually an HTML element, skip it
  6.         continue;
  7.     }
  8.     if(inputs[x].getAttribute('type') == 'hidden'){ // ensure it's a *HIDDEN* element
  9.         alert(inputs[x].getAttribute('name') + " : " + inputs[x].getAttribute('value'));
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement