<label for="username" class="ui-hidden-accessible">Username:</label> <input type="text" value="" placeholder="Username"/> 或者 <div data-role="fieldcontain" class="ui-hide-label"> <label for="username">Username:</label> <input type="text" value="" placeholder="Username"/> </div> 禁用表单元素:disable & enable 表单容器: data-role="fieldcontain" 刷新表单元素: 复选框: $("input[type='checkbox']").prop("checked",true).checkboxradio("refresh"); 单选框: $("input[type='radio']").prop("checked",true).checkboxradio("refresh"); 下拉菜单: var myselect = $("#selectfoo");myselect[0].selectedIndex = 3;myselect.selectmenu("refresh"); Sliders: $("input[type='range']").val(60).slider("refresh"); 开关: var myswitch = $("#selectbar");myswitch[0].selectedIndex = 1;myswitch.slider("refresh");
保持原生态:data-role="none"
滑块:
<label for="slider-0">Input slider:</label>
<input type="range" value="60" min="0" max="100" step="50"data-highlight="true"data-theme="a" data-track-theme="b"/>
开关:
<div data-role="fieldcontain">
<label for="flip-c">Flip switch:</label>
<select data-role="slider" data-theme="a">
<option value="no">No</option>
<option value="yes">Yes</option>
</select>
</div>
单选复选:type="radio" type="checkbox"水平排列<fieldset data-role="controlgroup" data-type="horizontal"> ,单选框name要一致。
<div data-role="fieldcontain"> <fieldset data-role="controlgroup"> <legend>Choose a pet:</legend> <input type="radio" value="choice-1" checked="checked" /> <label for="radio-choice-1">Cat</label> <input type="radio" value="choice-2" /> <label for="radio-choice-2">Dog</label> <input type="radio" value="choice-3" /> <label for="radio-choice-3">Pig</label> </fieldset> </div> 下拉菜单:弹出式data-native-menu="false" <div data-role="fieldcontain"> <label for="select-choice-5">Shipping method:</label> <select data-native-menu="false"> <option>Choose one...</option> <option value="standard">Standard: 7 day</option> <option value="rush">Rush: 3 days</option> <option value="express">Express: next day</option> <option value="overnight">Overnight</option> </select></div>