What is the best way to extend the Javascript prototype for all items of a certain class?
I want all textboxes (input) of a certain class to have
function OnValueChange()
{
// Wow!
}
This way I can add onblur="OnValueChange" to my input.
I can do it on an individual object by modify the prototype, but I am wondering if there a way to it for all items of a certain class or other distinguishing attribute.
I have access to jquery in my project
If you have access to jQuery then just use :
This way all current and future inputs with class inputClassNameHere will call OnValueChange when the blur event is triggered.