Skip to content

Instantly share code, notes, and snippets.

@patrickgombert
Created January 13, 2012 01:54
Show Gist options
  • Save patrickgombert/1604213 to your computer and use it in GitHub Desktop.
Save patrickgombert/1604213 to your computer and use it in GitHub Desktop.
Bad Javascript
var hider = function() {
$("#some_div").hide();
}
var shower = function() {
$("#some_div").show();
}
var total_column = function() {
var total = 0;
(".important_column").children().each(function() {
total += this.val();
}
return total;
}
$(function() {
$("#some_button").bind('click', hider);
$("#some_other_button").bind('click', shower);
$("form").bind('submit', $("#feedback").html(total_column()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment