跳至內容
選單
此問題已被標幟
4 回覆
2206 瀏覽次數

hello 

i am beginner in odoo 

i have three div have same class i want use this to call fun to one div only

thanks

頭像
捨棄
最佳答案

Hi,

You can use ":eq(index)"

https://api.jquery.com/eq-selector/

https://api.jquery.com/nth-child-selector/



頭像
捨棄
最佳答案

Hi, alice

You can try below code:

    $(this).on('click', ".classname", function () {});

Make sure it will helpful.

Thank you.

頭像
捨棄

"i want to use this call fun to one div only" - yours does all.

$(this).on('click', ".classname:eq(<div index>)", function () {});