non-jQuery equivalent of :visible in JavaScript?

前端 未结 3 438
南笙
南笙 2020-12-21 09:47

So jQuery provides this awesome pseudo to query in DOM on \':visible\', unfortunately, its rather heavily tied into the core of jQuery and Sizzle (or whatever engine you may

3条回答
  •  有刺的猬
    2020-12-21 10:30

    I'd recommend you use at the very least some selector library that does this work for you. Otherwise you're just wasting your effort in something that has already been tested and proven successful for no particular reason, and you're bound to probably even get it wrong the first few attempts you make.

    For instance Sizzle is only 4kb when minified/gzipped so I see virtually no reason not to use it.

提交回复
热议问题