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