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/Hiding Labels

<div data-role="fieldcontain" class="ui-hide-label">   <label for="username">Username:</label>   <input type="text" name="username" id="username"     value="" placeholder="Username"/> </div>

Labels are required on form inputs in jQuery Mobile. This allows the library to format the form elements appropriately for mobile devices. Therefore, you need to add a label and use the for attribute to link it to the form input. The good news is that jQuery mobile provides a class that you can easily hide the label with.

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