Skip to content

Instantly share code, notes, and snippets.

@mcavaliere
Last active December 21, 2015 21:07
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 mcavaliere/b257f4236c9a9c5b0176 to your computer and use it in GitHub Desktop.
Save mcavaliere/b257f4236c9a9c5b0176 to your computer and use it in GitHub Desktop.
var element = $("div.form-errors");
if (formHasErrors()) {
element.show();
}
// More, unrelated code...
var element = $("form#login");
element.addClass("has-errors");
// Another block of code...
$("input.submit").on("click", function() {
element.remove();
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment