Skip to content

Instantly share code, notes, and snippets.

@jcoglan
Created August 28, 2008 09:26
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 jcoglan/7689 to your computer and use it in GitHub Desktop.
Save jcoglan/7689 to your computer and use it in GitHub Desktop.
// Causes Ojay.HTML to add type-matching class names
// to all generated input tags
Ojay.HtmlBuilder.include({
input: Ojay.HTML.input.wrap(function() {
var args = Array.from(arguments),
input = args.shift().apply(null, args);
Ojay(input).addClass(input.type);
return input;
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment