Last active
August 29, 2015 14:13
-
-
Save samuelcar/a433d45dae3d494b01d9 to your computer and use it in GitHub Desktop.
detects when the user inputs over a forms field
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var propertyChangeUnbound = false; | |
| $("#testbox").on("propertychange", function(e) { | |
| if (e.originalEvent.propertyName == "value") { | |
| alert("Value changed!"); | |
| } | |
| }); | |
| $("#testbox").on("input", function() { | |
| if (!propertyChangeUnbound) { | |
| $("#testbox").unbind("propertychange"); | |
| propertyChangeUnbound = true; | |
| } | |
| alert("Value changed!"); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment