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 ...

Get jQuery and JavaScript Phrasebook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.