Select only visible text fields in jQuery

Is there a better way to do this in jQuery?

$(":text").each(function() {
   if (this.style.visibility == "visible") {
      ...
   };
});
+3
source share
3 answers

Yes

$(":text:visible").each(function() {
   ...
});

The UPDATE . Since jQuery is no longer working: details .

+5
source

You are looking for a :visibleselector:

$(':text:visible')
0
source

To use speed

$(':text').filter(":visible")
0
source

Source: https://habr.com/ru/post/1741668/


All Articles