There is a button in my app having text ADD TO LIST. When I click on that button, I would like to change the button text to ADDED TO LIST. Is that possible?
There is a button in my app having text ADD TO LIST. When I click on that button, I would like to change the button text to ADDED TO LIST. Is that possible?
Hello,
You can use next JS code on button click event
pre
Appery("mobilebutton_2").text("ADDED TO LIST");
/pre
Replace "mobilebutton_2" with your button component name.
Hey thanks Igor.. That worked perfectly. But the button size reduced. Can I change the button text alone without disturbing its size?
Hi Jyotsna,
It is better to change the text on the button through the Appery.io UI. On event click add 'Set property' action. Select button in the Component name, and its property 'text' - then its size won't be changed.
If you want to this this via JavaScript, then the code would be:
code$('[name=mobilebutton_1] .ui-btn-text').text('new text');/codewhere mobilebutton_1 is a button name
Hey thanks Katya... It worked perfectly..