I'm trying to dynamically change the text of the button. But the UI of button will mess up. Any idea why? http://jsfiddle.net/L6xRZ/
jQuery Mobile goes in and changes your HTML to get everything to work as it expects. As such when you are changing the time inside of your button you are undoing what jQuery Mobile stuck in for you.
The easiest possible change you could make would be to change your selector from "#svbutton" to the following line when you go and update the button text (fiddler here):
$('#svbutton .ui-btn-text').text(currentTimeString);
You should read up more on how jQuery Mobile works and how to use it dynamically on their documentation page on Page Scripting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With