The jQuery Mobile framework enhances the form and its controls by default. This recipe shows you the different ways you can set native styling for your form controls and also how to auto-initialize these controls.
Copy the full code of this recipe from the code/05/native-style
sources folder. This code can be launched using the URL http://localhost:8080/05/native-style/main.html
.
In
main.html
, add the following script to the<head>
section to natively style all buttons:$(document).bind('mobileinit', function() { $.mobile.page.prototype.options.keepNative = 'button'; });
Add a form to the page content to set native styles on the controls:
<form action='#' method='post'> <p><label for='button1'>Button 1</label></p> <button name='button1'>Button: keepNative configuration</button> <p><label for='button2'>Button 2</label></p> <button name='button2' data...