title: alert a variable value
body: <p>How do I display the value of a variable in javascript in an alert box?</p>
  
  <p>For example I've got a variable x=100 and alert(x) isn't working.</p>
  
  <p>the script used in grease monkey is here</p>
  
  <pre><code>var inputs = document.getElementsByTagName('input');
  
  var new;
  for (i=0; i&lt;inputs.length; i++) {
    if (inputs[i].getAttribute("name") == "ans") {   
  new=inputs[i].getAttribute("value"));
  
  alert(new)
  
    }
  }
  </code></pre>