<canvas height="30"> <class name="mybutton" extends="button"> <attribute name="myattr" type="string" value="after"/> </class> <mybutton text="before" myattr="123" onclick="setAttribute('text', this.myattr)"/> </canvas>
after