O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding Form Elements

jQuery Mobile elements are for the most part standard. jQuery Mobile formats them for better display on mobile devices. However, there are a few data attributes that you should be aware of:

Image data-role="fieldcontain"—Add to a container class around multiple form elements. Helps mobile elements, especially <label> elements, track closer.

Image class="ui-hide-label">—Adding this class to a fieldcontain container causes the label to hide.

data-role="button"—Forces <a> links to be displayed as mobile buttons.

data-icon—Specifies an icon ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required