Jquerymobile Form Basic
* * *
jQuery Mobile automatically styles HTML forms to make them more attractive and more touch-friendly.
* * *
* * *
## jQuery Mobile Form Structure
jQuery Mobile uses CSS to style HTML form elements, making them more attractive and easier to use.
In jQuery Mobile, you can use the following form controls:
* Text input fields
* Search input fields
* Radio buttons
* Checkboxes
* Select menus
* Sliders
* Flip toggle switches
When using jQuery Mobile forms, keep in mind:
* The `` element must have both a `method` and an `action` attribute.
* Each form element must have a unique `id` attribute. The `id` must be unique across all pages of your entire site. This is because jQuery Mobileβs single-page navigation mechanism may render multiple different pages simultaneously.
* Each form element must have a label. Set the labelβs **for** attribute to match the elementβs `id`.
## Example
[Try it yourself Β»](#)
To hide the label, use the class `ui-hidden-accessible`. This is commonly used when you use the elementβs `placeholder` attribute as the label:
## Example
[Try it yourself Β»](#)
**Tip:** You can add a clear button (an βXβ icon on the right side of the input field) by using the `data-clear-btn="true"` attribute:
## Example
[Try it yourself Β»](#)
|  | The clear button can be used with `` elements, but not with `
YouTip