简单的拼接字符串方法 新建数组 然后push()进去内容 最后join(“”)分割

Dom.$plus.one('click',function(){
var $tit = $(this).parent(".computed").siblings(".food_big_con_right_tit").html();
var $single_price = $(this).siblings(".single_price").html();
var result = [];
result.push('<li class="clearfix">');
result.push('<span class="food_name">'+$tit+'</span>');
result.push('<div class="do_list">');
result.push('<span>¥</span>');
result.push('<strong class="last_item_price">'+$single_price);
result.push('</strong>');
result.push('<img src="images/f/minus.png" class="minus">');
result.push('<span class="last_count">'+1);
result.push('</span>')
result.push('<img src="images/f/plus2.png" class="plus_count">');
result.push('</div> </li>');
result=result.join("");
$('.bottom_menu_list ul').append(result);
// 购物车的数量
var len = Dom.$bottom_menu_list.find("ul li").length;
Dom.$car_number.html(len);
});
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值