title: Using JS for creating form document
body: <p>This is my JS:</p>
  
  <pre><code>function validateEmail(emailaddress){  
         var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;  
         if(!emailReg.test(emailaddress)) {  
              alert("Please enter valid email id");
         }       
      }
  </code></pre>
  
  <p>This is my HTML:</p>
  
  <pre><code>&lt;div id="newsletter"&gt;
  Register Our NewsLetter: &lt;input type="email" placeholder="example123@example.com" id="email"/&gt;
  &lt;br&gt;&lt;br&gt;
  &lt;input id="submit_button" type="submit" value="Submit" onclick="validateEmail('email')"/&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p><b><a href="http://jsbin.com/lutukiyu/1" rel="nofollow">JSBIN</a></b><br>
  I requested from the submit button on-clicking at him to call <code>validateEmail</code> with the argument <code>email</code> which is the input.<br>
  It always returns me the alert, for unknown reason.<br>
  I've already checked it for million times and I couldn't find a mistake.  </p>
  
  <p>THanks in advance</p>