跳至内容
菜单
此问题已终结
4 回复
2214 查看

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