Difference between hidden and not visible in jQuery

0 votes

I know that both jQuery selectors match elements that are not visible (width or height equal to 0, display: none, parent with display: none), and I believe it is implied they should yield the same result in the docs.

For readability reasons, I would rather use :hidden but I want to know:

  • Are there any potential pitfalls that I should consider?
  • Will I always get the exact same result?
  • Which option has better performance?

Jun 13, 2022 in JQuery by gaurav
• 23,260 points
520 views

1 answer to this question.

0 votes

During animations that hide an element, the element is considered to be visible until the end of the animation. Elements that are not in a document are not considered to be visible; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

answered Jun 14, 2022 by gaurav
• 23,260 points

Related Questions In JQuery

0 votes
1 answer

difference between $ and $() in jQuery

JavaScript: It is a major scripting programming language ...READ MORE

answered Jun 10, 2022 in JQuery by rajatha
• 7,640 points
333 views
0 votes
1 answer

What is the difference between jQuery: text() and html() ?

Hello @kartik, The text() method entity-escapes any HTML that is ...READ MORE

answered Nov 25, 2020 in JQuery by Niroj
• 82,880 points
808 views
0 votes
1 answer

JQuery Difference between hide() and fadeOut() , show() and fadeIn()

Main difference between FadeIn, FadeOut vs hide, ...READ MORE

answered Jun 1, 2022 in JQuery by Edureka
• 13,670 points
266 views
0 votes
1 answer

addClass and removeClass in jQuery - not removing class

What happens is that your close button ...READ MORE

answered Jun 2, 2022 in JQuery by Edureka
• 13,670 points
8,980 views
0 votes
1 answer

addID in jQuery?

To answer your doubt, ID is an ...READ MORE

answered Feb 8, 2022 in Others by Soham
• 9,700 points
3,436 views
0 votes
1 answer

jQuery find all elements with class beneath parent, even in children elements

Remove > from your select $(".parent .searchEl"). You can use the .find() method ...READ MORE

answered Jun 7, 2022 in JQuery by Edureka
• 13,670 points
9,715 views
0 votes
0 answers

jQuery find and replace string

I have somewhere on website a specific ...READ MORE

Jun 10, 2022 in JQuery by gaurav
• 23,260 points
4,495 views
0 votes
0 answers

Get the value in an input text box

What are the ways to get and ...READ MORE

Jun 29, 2022 in Web Development by gaurav
• 23,260 points
174 views
0 votes
1 answer

What is the difference between AJAX with JavaScript and jQuery?

JavaScript is a programming language. JQuery is ...READ MORE

answered May 30, 2022 in JQuery by gaurav
• 23,260 points
490 views
0 votes
1 answer

Calculate the number of days between a cell and today in excel?

Excel Formula to Calculate Number of Days ...READ MORE

answered Jun 9, 2022 in JQuery by gaurav
• 23,260 points
268 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP