jquery find to get the first element

前端 未结 6 1427
忘掉有多难
忘掉有多难 2020-12-29 19:11

I am writing $(this).closest(\'.comment\').find(\'form\').toggle(\'slow\'); and the problem is each of the forms in the child is being toggled. I would like on

6条回答
  •  轮回少年
    2020-12-29 19:45

    Use :first selector like below :

    $(this).closest('.comment').find('form:first').toggle('slow');
    

提交回复
热议问题