Radio button with Jquery Mobile apply styling!!

来源:互联网 发布:作诗软件下载 编辑:程序博客网 时间:2024/05/17 17:58

想要在radio button 添上  Jquery mobile styling 必须添上 <label>tag.

错误:

<input type ="radio" value="1" name="select-answer" id="select-answer" /> Agree<input type ="radio" value="1" name="select-answer" id="select-answer" />Disagree<input type ="radio" value="2" name="select-answer" id="select-answer"/>Strongly Agree <input type ="radio" value="3" name="select-answer" id="select-answer"/>Strongly Disagree

正确:

<fieldset data-role="controlgroup"><input type ="radio" value="0" name="select-answer" id="select-answer-1" /><label for="select-answer-1">Agree</label> <input type ="radio" value="1" name="select-answer" id="select-answer-2" /><label for="select-answer-2">Disagree</label> <input type ="radio" value="2" name="select-answer" id="select-answer-3"/><label for="select-answer-3"> Strongly Agree </label><input type ="radio" value="3" name="select-answer" id="select-answer-4"/><label for="select-answer-4"> Strongly Disagree </label></fieldset>