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
778 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,680 points
556 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,840 points
1,097 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,690 points
474 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,690 points
10,884 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,710 points
5,462 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,690 points
10,801 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
5,535 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
486 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
825 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
573 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