ホーム » jQuery Mobile

jQuery Mobile」カテゴリーアーカイブ

jQuery Mobileのcheckboxを動的に作成

jQuery Mobile でCheckBoxを作るには以下のHTMLを組む必要がある

[code]
<label>
<input type="checkbox" name="checkbox-0 ">Check me
</label>
[/code]

DEMO

これをjQueryで動的に作成

[code]
var id_check_bookmark = ‘id-chk-bookmark-‘+handle;

var h_lbl = $("<label />", {
‘text’ : ‘bookmark’
});

var h_chekcbox = $("<input />", {
‘type’ : ‘checkbox’,
‘id’ : id_check_bookmark
});

h_chekcbox.appendTo(h_lbl);

h_content.append(h_lbl);
[/code]

部品メモ

リスト

http://demos.jquerymobile.com/1.3.0-rc.1/docs/demos/widgets/listviews/

Listview Widget

http://jquery-mobile.tecc0.com/04listview.html

http://forresst.github.io/demos/sortable/en/index.html

jQuery Mobile さまざまなスタイルのリスト例

http://www-db.deis.unibo.it/courses/TW/DOCS/w3schools/jquerymobile/jquerymobile_examples.asp.html