Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input type="number" value="0" />
- $('input').on('input', function () {
- var value = $(this).val();
- $(this).val(Math.max(Math.min(value, 90), -90));
- });
- $('input').on('input', function () {
- var value = $(this).val();
- if ((value !== '') && (value.indexOf('.') === -1)) {
- $(this).val(Math.max(Math.min(value, 90), -90));
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement