As to setHTML and alignment - the control expects its template to be an element, not a text node and applies the styling to an element, which causes the error.
Moreover,
setHTML doesn’t change the label value, only appearance
getValue() return exactly what one stated via setValue()
if value is the same, setValue() method won’t cause label redrawing.
Thanks Helga, actually your snippet doesn’t work for me !
Try alternating between clicking button ‘two’ and button ‘three’ you’ll see that that button ‘two’ only works once, then stops working.
Actually, it works as expected - you set value “two” to a label, then set html “three”. Value remains the same - you can check it with the getValue() method. After that if you try to set the same value “two”, button won’t be redrawn as value hasn’t changed while setting other value will change the button’s appearance.