jQuery - using inArray() to find index of jQuery object

后端 未结 7 1219
粉色の甜心
粉色の甜心 2021-01-19 02:09

I have a few divs that I\'d like to put into an array.

When I try to use jQuery.inArray(), my div (as a jQuery object) isn\'t found. Why not?

var my         


        
7条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-19 02:30

    You can't use .inArray() for object comparison by content.

    I like the approach outlined here. It's very clean.

提交回复
热议问题