我正在使用SmartCart.js
腳本將產品從一個div標籤添加到另一個div標籤,但是當我運行此代碼時,未添加產品按鈕事件。爲什麼?jQuery - 添加到div標籤的按鈕事件未被觸發
var HTML = '<div class="scProductListItem">'+
'<table border="0" cellpadding="2" cellspacing="2">'+
'<tr>'+
'<td rowspan="3"><img width="100px" src="http://webscopia.com/wp-content/uploads/2011/06/Google.plus-get-an-invite-from-me.jpg" alt="Not availabel" /></td>'+
'<td><strong><span id="prod_name'+'test'+'">'+'detail_product[0]'+'</span></strong></td>'+
'</tr>'+
'<tr>'+
'<td>'+
'<input type="button" rel="'+'test'+'" class="scItemButton scBtn" value="Add Product">'+
'</td>'+
'</tr>'+
'</table>'+
'<input type="button" value="TestButton" name="Test" onclick="Alert()"/>'+
'</div>';
$('#sc_productlist').append($(HTML));
添加產品。這些按鈕的事件我無法接收。
如何以及何時是事件處理程序連接到*添加產品*按鈕? –