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/
Asked
Active
Viewed 5,571 times
1 Answers
15
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.

scottheckel
- 9,106
- 1
- 35
- 47