search

Home  >  Q&A  >  body text

为什么给的prev传递选择器代码显示出来的结果只有clsaa=“level-3”的2添加上了蓝色的框,而不是每一个2都有边框?

checkcheck2930 days ago1165

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-09-30 23:02:07

    Why does the prev pass selector code show that only the 2 with clsaa="level-3" has a blue frame added, instead of each 2 having a border? -PHP Chinese website Q&A-Why does the prev pass selector code show that only the 2 with clsaa="level-3" has a blue frame added, instead of each 2 having a border? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 迷茫

    迷茫2016-12-20 09:21:53

    因为做了筛选啊。$('.item-3').prev(':last')这句的意思是:找到类名为item-3的所有紧邻前兄弟节点中的最后一个。所以只有最后一个有蓝色框

    reply
    1
  • Cancelreply