title: jQuery allow only number or decimal point or percentage sign
body: <p>i just want to allow value like below to pass: </p>
  
  <p>18
  12.5%
  13%</p>
  
  <p>not allowing any other like:
  12ad
  aa21</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>if( /[0-9\.]+%?/.test( shop_price ) == true){      
      $("#shop_price_label").html("Please enter number or number % only")
      event.preventDefault();</code></pre>
  </div>
  </div>
  </p>
  
  <p>but its not working with the above code. can anyone help me with this?</p>