Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何使用数据角色、数据主题、内容主题、插入、listview动态创建div?_Jquery_Css - Fatal编程技术网

Jquery 如何使用数据角色、数据主题、内容主题、插入、listview动态创建div?

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')

如何使用数据角色、数据主题、内容主题、插入、listview动态创建div 使用JQuery。 我举了一些我尝试过的例子:

    $('<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');