Created
January 11, 2012 21:34
Revisions
-
brandonaaskov created this gist
Jan 11, 2012 .There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ /* For some reason, the change() event only fires when the input field loses focus. Binding to other options ('change keypress paste focus textInput input') will fire the event several times, which is bad. The below code works even when content is pasted into the text field, and only fires once as expected. */ $('#search-form .term').bind('input', function(){ console.log('this actually works'); }); /* HTML example: <form id="search-form"> <input type="text" class="term" name="Search" value="Search" autocomplete="off" /> <input type="submit" name="Search" value="Search" /> </form> */