2

In my JQ Mobile project I am using JQuery to create a button and append it to a div:

      var input = '<input type="button" class="save_event" value="Save"/>';
      $('.event').append(input);

However, this button seems exempt from Jquery Mobiles styling - it just appears as a normal webkit button. Would anyone know of a way to allow JQM's CSS to style this element?

1 Answer 1

1

You also need to do:

$('[type="button"]').button();

Working example: http://jsfiddle.net/Gajotres/m4rjZ/

If you want to find out more about styling of dynamically created jQM elements take a look at my other answer: jQuery Mobile: Markup Enhancement of dynamically added content

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.