Created
April 21, 2012 05:51
-
-
Save esbanarango/2434505 to your computer and use it in GitHub Desktop.
jQuery code on the client-side showing how Event-Driven programming works
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 characters
// jQuery code on the client-side showing how Event-Driven programming works | |
// When a button is pressed, an Event occurs - deal with it | |
// directly right here in an anonymous function, where all the | |
// necessary variables are present and can be referenced directly | |
$("#myButton").click(function(){ | |
if ($("#myTextField").val() != $(this).val()) | |
alert("Field must match button text"); | |
}); | |
//From. | |
//http://www.ibm.com/developerworks/ssa/opensource/library/os-nodejs/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment