So, I want redefine constructor of HTMLButtonElement with input args. I know how to do this without args:
var CButtonPrototype = Object.create(HTMLButtonElement.prototype);
CButtonPrototype.createdCallback = function()
{
alert("call");
this.setAttribute("class", "some class");
this.value = 0;
this.innerHTML = "some text";
};
var CButton = document.registerElement('cbutton', {
prototype: CButtonPrototype
});
var myButton = new CButton();
And it's works, but I want use this class something like var myButton = new CButton(arg 1, arg 2, etc);. This method don't let me doing CButtonPrototype.createdCallback = function(arg 1, arg2). How can I resolve this? Maybe you know another way?
Thanks \o/