请检查此代码:http: //jsfiddle.net/Hce8y/
我正在尝试生成分组复选框列表:
function ItemCode_Changed(sender, onload) {
$('#category-contianer-id-3').append(
'<div data-role="fieldcontain">'
+ '<fieldset data-role="controlgroup">'
+ '<legend>Choose as many:</legend>'
+ '<input type="checkbox" name="checkbox-1a" id="checkbox-1a" class="custom" />'
+ '<label for="checkbox-1a">Cheetos</label>'
+ '<input type="checkbox" name="checkbox-2a" id="checkbox-2a" class="custom" />'
+ '<label for="checkbox-2a">Doritos</label>'
+ '<input type="checkbox" name="checkbox-3a" id="checkbox-3a" class="custom" />'
+ '<label for="checkbox-3a">Fritos</label>'
+ '<input type="checkbox" name="checkbox-4a" id="checkbox-4a" class="custom" />'
+ '<label for="checkbox-4a">Sun Chips</label>'
+ '</fieldset>'
+ '</div>');
$('#category-contianer-id-3 [data-role="fieldcontain"]').fieldcontain();
$('#category-contianer-id-3 [data-role="fieldcontain"]').fieldcontain('refresh');
$("#category-contianer-id-3 input[type='checkbox']").checkboxradio();
$("#category-contianer-id-3 input[type='checkbox']").checkboxradio('refresh');
//$('#my-home').page();
}
更改输入中的文本时,但结果看起来不像演示。
是否有任何错误,任何帮助表示赞赏。