I was working for form events and decided to make prototypes for the event handlers. As this is a nice way to code, I wanted share it.
It will be used as:
myform.onChange( function(name, value, isChecked){
console.log(arguments)
})
This a tab bit easier for me to remember and easier to read than:
myform.attachEvent("onChange", function(name, value, isChecked){
console.log(arguments)
})
Here’s how the prototype is created:
dhtmlXForm.prototype.onChange = function(cb){
this.attachEvent("onChange", cb)
}