title: Jquery / Regex Validation
body: <p>I have the following input.</p>
  
  <pre><code>&lt;input type="tel"  id="Phone maxlength="10"/&gt;
  </code></pre>
  
  <p>I'm trying to use Jquery amd regex to validate the number's format.</p>
  
  <p>The jquery / regex is as follows.</p>
  
  <pre><code>  $(function () {
      var reg = /(([2-9]{1})([0-9]{2})([0-9]{3})([0-9]{4}))$/
      var Input = $("input#phone").val();
      if ($(z).val() == (reg)) {
      alert("Valid")
      }
    });  
  </code></pre>
  
  <p>This is not working for me, does anyone see why? Or is there a better way to do this?]</p>