title: How to make the input box in HTML to make it only accept IP ADDRESS
body: <p>Please help me with my problem. </p>
  
  <p>How can I make my input box only accept IP Addresses whilst now allowing any text? </p>
  
  <p>When I set the input type to <code>NUMBER</code> it disables the submit button, for example, the input box only accepts input for IP addresses like <code>192.168.206.103</code> and it doesn't accept alphabet. 
  Here is my code:</p>
  
  <p>Script:</p>
  
  <pre><code>function displayCam()
  {
      var ip = document.getElementById('ipadd');
      var portz = document.getElementById('portz');
      //document.getElementById('camView').innerHTML = ip.value;
      var link = document.getElementById('camView').href="http://"+ip.value+":"+portz.value;
      window.location.href =link;      
  }
  </code></pre>
  
  <p>CODE:</p>
  
  <pre><code>&lt;h1&gt;Input IP Address&lt;/h1&gt;
  
  &lt;label for="ipadd"&gt;Enter IP Address:&lt;/label&gt;
      &lt;input type='text' id='ipadd' required="required" placeholder="XXX.XXX.XXX.XXX"&gt;
  
  
  
  &lt;label for="portz"&gt;Enter Port:&lt;/label&gt;
      &lt;input type='number' id='portz' pattern=".{1.4}" &gt;
      &lt;input type='button' onclick='displayCam()' value='Submit' required="required"&gt;
  
  &lt;div id="camView"&gt; &lt;/div&gt;
  </code></pre>