Js代码
1 var str1 = "<button type='button' class='btn btn-primary' onclick='SaveNewGoodsInfo( '"+goodsnum+"',1)'>保存</button>"; 2 3 $("#span_btnSave").html(str1);
结果
1 <span id="span_btnSave"><button type="button" class="btn btn-primary" onclick="SaveNewGoodsInfo( " g1023',1)'="">保存</button></span>