Regular expression pattern: from 0 to 120 with interval of 5 and white space allowed - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:jQuery Method Example

Description

Regular expression pattern: from 0 to 120 with interval of 5 and white space allowed

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-git.js"></script> 
  <script type="text/javascript">
    $(window).on('load', function() {
$('form').on('submit', function(evt) { return false; });
    });// w w w  .  j  a  v a  2  s . co m

      </script> 
 </head> 
 <body> 
  <form method="post"> 
   <input type="text" pattern="^(((\d|1[0-1])?(0|5)|120)|)$"> 
  </form>  
 </body>
</html>

Related Tutorials