Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
2198 มุมมอง

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 () {});