What I would what to do is when I call var alert=new alert_button('button'); all the methods and properties from alert_button class woud be passed to the object of the element form whit the ID informed (in this case the id button that is from a input element)! This would be very useful because if I what to add a new methods to that elements I would only have to add the method to the class!
The problem is that I cant do that passing of methods, I think that the problem is because the object is already instantiated after I try to pass the new methods! (Note that the object type in this case is a input type button, but it could be any type, for example it could be a anchor link).
Yes the idea is to extend the element object to gain the attributes and methods of the class being called, in this case "alert_button"! That is the idea! But extending the class seams to me like a unlike way, the element object (in this case the input button) is already created when I create the new class that would have the job to add the new methods and properties to the object! No?