Bootstrap 4 Button icon


#1

If i set the Bootstrap button to have an icon at design time, then during run time i set the value of the button using Button1.value = “Test”, the icon disappears.

Is there a way to stop the icon disappearing?

Thanks


#2

Yes. You need to set both the icon and the text:

Button1.innerHTML = "<span id=Button1_icon class='oi oi-menu'><span>Bill"

#3

Thanks, that is working fine.