代码一 var aa = $("<a href='#'></a>");
var img = $("<img style='width:80px;height:80px'>");
$("img").prop("src","/numberoneshop"+this.img);
$("aa").append(img);
var adiv = $("<div class='list_img'></div>");
$("adiv").append(aa);
var bdiv =$("<div class='list_text'></div>");
$("bdiv").text(this.name);
var ali = $("<li class='list_con' style='float:left'></li>");
$("ali").append(adiv);
$("ali").append(bdiv);
代码一不可以通过
将代码一合起来写通过,原因未明。
var ali = $("<li class='list_con' style='float:left'><div class='list_img'><img src='/numberoneshop"+this.img+"' style='width:80px;height:80px'></div><div class='list_text'></div></li>");
相关问题
- Save html in cookie
- How to append a file, asynchronously in Windows Ph
- vb6 Open File For Append issue Path Not Found
- How do I concatenate string to an existing file?
- append a list at the end of each row of 2D array
相关文章
- Append input text field with value of a div
- Is there an easy way to concatenate several lines
- Speeding up data-import function (Pandas and appen
- Add div on click, then toggle it on every click af
- jquery - append Icons generated by for loop into l
- Append element to QueryList Angular
- What's wrong with Prolog's append?
- Appending characters to a List string
方法不对,多个拼接的时候 var ali = '<li class='list_con' style='float:left'>'+ '<div class='list_img'>'+,,,,,,,,,,多个标签用引号包起来组合,; 还有你前面的$() 括号里面是写选择器的 不是写标签的