我设法在 JQuery 中为我的复选框设置样式,因为我希望它们看起来:
var content = '<fieldset data-role="controlgroup" class="ui-corner-all ui-controlgroup ui-controlgroup-vertical">' +
'<div class="ui-controlgroup-controls">' +
'<div class="ui-checkbox">' +
'<input type="checkbox" name="checkbox-1a" id="checkbox-1a" class="custom">' +
'<label for="checkbox-1a" data-corners="true" data-shadow="false" data-iconshadow="true" data-wrapperels="span" data-theme="c" class="ui-btn ui-btn-icon-left ui-corner-top ui-checkbox-on ui-btn-up-c">' +
'<span class="ui-btn-inner ui-corner-top"><span class="ui-btn-text">Food</span><span class="ui-icon ui-icon-shadow ui-icon-checkbox-on"> </span></span></label></div>' +
'<div class="ui-checkbox">' +
'<input type="checkbox" name="checkbox-4a" id="checkbox-4a" class="custom">' +
'<label for="checkbox-4a" data-corners="true" data-shadow="false" data-iconshadow="true" data-wrapperels="span" data-icon="checkbox-off" data-theme="c" class="ui-btn ui-btn-up-c ui-btn-icon-left ui-checkbox-off ui-corner-bottom ui-controlgroup-last">' +
'<span class="ui-btn-inner ui-corner-bottom ui-controlgroup-last"><span class="ui-btn-text">Sun Chips</span><span class="ui-icon ui-icon-checkbox-off ui-icon-shadow"> </span></span></label></div>' +
'</div></fieldset>';
结果是静态的(单击按钮时没有操作或状态更改)。
如何让它们充当普通复选框,单击时更改其选中状态?
谢谢!