How to set button icon position & text dinamically


I tried to set a button icon position and text data at runtime with button click function.

$( "#startScreen_button_callme" ).attr( "data-iconpos", "left" );
setAttribute_('startScreen_button_callme', 'Text', "+xx-xx-xxx-xxxx");

Above js code change data-iconpos to "left" from "notext" and text is in .. section, i see it in browser console, but does not appear on the screen.

How can i solve this?

If that can't possible, how can i remove white place from icon right side when position is left and no text in Text attribute.

Thanks any help!
1 person has
this question
This topic is no longer open for comments or replies.