我有一個按鈕控件與模式生成的ID作爲搜索結果 這是對象ID。從動態生成的控件的jquery事件
在第一次搜索我有3個結果:
<input type="button" id="product_0" >
<input type="button" id="product_1" >
<input type="button" id="product_2" >
另一個結果建立了我2個結果
<input type="button" id="product_23" >
<input type="button" id="product_34" >
我怎麼能處理他們的jQuery的事件?
例如:
$("product_id").click(function(){
});
Cybernate有一個更好的選擇器,所以你應該去與他的迴應。 – Sage 2011-03-30 16:39:53
已過時,但作爲Google的第一個結果。 – ppumkin 2015-03-16 10:43:49
@ppumkin更新了答案。 – Chandu 2015-03-16 12:17:50