CRM 2011 JS: Attach event to attribute using javascript in CRM 2011

//This is how to Attach event to attribute using javascript in CRM 2011

Attach event to attribute

crmForm.all.new_isdue.attachEvent("onclick", Onisdueclick);
function  Onisdueclick () {
    alert('Hi');
}