js追加html元素

时间:2024-03-05 13:46:25

jquery追加html代码,添加元素

.append()
        //新增仲裁申请人
         $("."+inputName).append("<div class=\"form-group\"><label for=\"accuser\" class=\"col-xs-2 control-label\"></label>\n" +
             "<div class=\"col-xs-4\">\n" +
             "<input type=\"text\" class=\"form-control\" id=\"\" name=\"\" value=\"\" >\n" +
             "</div>" +
             "<div className=\"col-xs-1\">"+
             "<span style=\'font-size: 20px;color: red;cursor:pointer\' onclick=\'deleteThis(this)\'>×</span>"+
            "</div>"+
             "</div>");