Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
4 Răspunsuri
2207 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

You can use ":eq(index)"

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

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



Imagine profil
Abandonează
Cel mai bun răspuns

Hi, alice

You can try below code:

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

Make sure it will helpful.

Thank you.

Imagine profil
Abandonează

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

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