Skip to content

Instantly share code, notes, and snippets.

@esbanarango
Created April 21, 2012 05:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esbanarango/2434505 to your computer and use it in GitHub Desktop.
Save esbanarango/2434505 to your computer and use it in GitHub Desktop.
jQuery code on the client-side showing how Event-Driven programming works
// 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