用js拼接的html ,里面的class属性失效,帮忙看看应该如何拼接!_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 08:53:38
Original
2572 people have browsed it

                  var strhtml = ''; 
strhtml +='

';
strhtml +=' ';
strhtml +='';
strhtml +=' ';
strhtml +='
';
strhtml +='
';
$("#add").after(strhtml);


回复讨论(解决方案)

var strhtml = " 

"
                        + "  "
                        + " "
                        + " "
                        + " 
";
            $("#add").append(strhtml);

easyUI用js拼接的话要有效需要"唤醒",试试在append后加上
 $.parser.parse($("#add"));

after是添加在当前元素外部后面 append是添加在当前元素内部后面

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!