8

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/

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.