Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#amount:input").data('oldVal', $("#amount:input").val());
- $("#amount:input").change(function(){
- var newVal = $(this).val();
- var oldVal = parseFloat($(this).data('oldVal'));
- if ( newVal > oldVal) {
- // Do something
- } else {
- // Do something
- }
- $(this).data('oldVal', newVal)
- })
- .focus(function(){
- $(this).data('oldVal', $(this).val());
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement