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?

Gajotres
  • 57,309
  • 16
  • 102
  • 130
MeltingDog
  • 14,310
  • 43
  • 165
  • 295

1 Answers1

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

Community
  • 1
  • 1
Gajotres
  • 57,309
  • 16
  • 102
  • 130