Jquery 如何使用数据角色、数据主题、内容主题、插入、listview动态创建div?
如何使用数据角色、数据主题、内容主题、插入、listview动态创建div 使用JQuery。 我举了一些我尝试过的例子:Jquery 如何使用数据角色、数据主题、内容主题、插入、listview动态创建div?,jquery,css,Jquery,Css,如何使用数据角色、数据主题、内容主题、插入、listview动态创建div 使用JQuery。 我举了一些我尝试过的例子: $('<div>').attr('id', 'divCollapsibleset') .data('role', 'collapsibleset') .data('data-theme', 'e') .data('content-theme', 'a')
$('<div>').attr('id', 'divCollapsibleset')
.data('role', 'collapsibleset')
.data('data-theme', 'e')
.data('content-theme', 'a')
.appendTo('#popupNested');
$('<div>').data('role', 'collapsible')
.attr('id', 'divCollapsible')
.data('inset', 'false')
.appendTo('#divCollapsibleset');
$('<h3>').addClass('h3-register-items')
.text('Register')
.appendTo('#divCollapsible');
$('<ul>').data('role', 'listview')
.attr('id', 'listOfItems')
.appendTo('#divCollapsible');
$('').attr('id','divcollapsableset')
.data('角色','可折叠集')
.data('data-theme','e')
.data('content-theme','a')
.appendTo('popupNested');
$('').data('角色','可折叠')
.attr('id','divcollapsable')
.data('插入','假')
.appendTo(“#divcollapsableset”);
$(“”).addClass('h3-register-items'))
.text(“寄存器”)
.appendTo(“#可拆分”);
$(“”).data('role','listview')
.attr('id','listOfItems')
.appendTo(“#可拆分”);
数据角色、数据主题、内容主题、插图、列表视图
这些也是属性?。。。还可以使用attr()
样品
$('<div>').attr('id', 'divCollapsibleset')
.attr('data-role', 'collapsibleset')
.attr('data-theme', 'e')
.attr('content-theme', 'a')
.appendTo('#popupNested');
$('').attr('id','divcollapsableset')
.attr('数据角色','可折叠集')
.attr('data-theme','e')
.attr('content-theme','a')
.appendTo('popupNested');
或
$('').attr({
'id':'divcollapsableset',
“数据角色”:“可折叠集”,
“数据主题”:“e”,
“内容主题”:“a”
}).appendTo('popupNested');
数据('role',value)
与attr('data-role',value)
不同,如果您有另一个为其运行的脚本。。。就像一个主题脚本,在这些之后运行它。。。。
$('<div>').attr({
'id': 'divCollapsibleset',
'data-role': 'collapsibleset',
'data-theme': 'e',
'content-theme': 'a'
}).appendTo('#popupNested');