Can I combine a variable and a selector in Jquery?

前端 未结 3 2100
-上瘾入骨i
-上瘾入骨i 2021-02-15 14:12

Say I have this HTML:

top
middle
bottom
middle
3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-15 15:06

    Could you just select it like this:

    $('.top .middle').click();
    

提交回复
热议问题