Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. <input type="number" value="0" />
  2.  
  3. $('input').on('input', function () {
  4.  
  5. var value = $(this).val();
  6. $(this).val(Math.max(Math.min(value, 90), -90));
  7. });
  8.  
  9. $('input').on('input', function () {
  10.  
  11. var value = $(this).val();
  12.  
  13. if ((value !== '') && (value.indexOf('.') === -1)) {
  14.  
  15. $(this).val(Math.max(Math.min(value, 90), -90));
  16. }
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement