ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 3.9 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible |
| Last Crawled | 2025-12-22 08:15:31 (3 months ago) |
| First Indexed | not set |
| HTTP Status Code | 200 |
| Meta Title | javascript - JQuery: if div is visible - Stack Overflow |
| Meta Description | null |
| Meta Canonical | null |
| Boilerpipe Text | I'm using JS as a way of changing the content of an SPA I'm creating. When I press a button to change the content the HTML changes from this:
<
div
id
=
"selectDiv"
style
=
"display: none;"
>
to this:
<
div
id
=
"selectDiv"
style
>
Now part of my SPA has a div that contains a number of checkboxes, each representing a div, and so when I press the submit button, the next div that should be displayed will be the first item in the checkbox list that was selected.
I'm wondering if there's a way in JQuery for the code to "almost detect" which div is now visible. something like this:
if
($('#selectDiv')
.isVisible
()){
//JS code associated with this div.
}
Any suggestions? |
| Markdown | # 
By clicking “Sign up”, you agree to our [terms of service](https://stackoverflow.com/legal/terms-of-service/public) and acknowledge you have read our [privacy policy](https://stackoverflow.com/legal/privacy-policy).
# OR
Already have an account? [Log in](https://stackoverflow.com/users/login)
[Skip to main content](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible#content)
[Stack Overflow](https://stackoverflow.com/)
1. [About](https://stackoverflow.co/)
2. Products
3. [For Teams](https://stackoverflow.co/internal/)
1. [Stack Internal Implement a knowledge platform layer to power your enterprise and AI tools.](https://stackoverflow.co/internal/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams)
2. [Stack Data Licensing Get access to top-class technical expertise with trusted & attributed content.](https://stackoverflow.co/data-licensing/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api)
3. [Stack Ads Connect your brand to the world’s most trusted technologist communities.](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising)
4. [Releases Keep up-to-date on features we add to Stack Overflow and Stack Internal.](https://stackoverflow.blog/releases/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=releases)
5. [About the company](https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) [Visit the blog](https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog)
1. ### [current community](https://stackoverflow.com/)
- [Stack Overflow](https://stackoverflow.com/)
[help](https://stackoverflow.com/help) [chat](https://chat.stackoverflow.com/?tab=explore)
- [Meta Stack Overflow](https://meta.stackoverflow.com/)
### your communities
[Sign up](https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F40468981%2Fjquery-if-div-is-visible) or [log in](https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F40468981%2Fjquery-if-div-is-visible) to customize your list.
### [more stack exchange communities](https://stackexchange.com/sites)
[company blog](https://stackoverflow.blog/)
2. [Log in](https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F40468981%2Fjquery-if-div-is-visible)
3. [Sign up](https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F40468981%2Fjquery-if-div-is-visible)
# Let's set up your homepage Select a few topics you're interested in:
python
javascript
c\#
reactjs
java
android
html
flutter
c++
node.js
typescript
css
r
php
angular
next.js
spring-boot
machine-learning
sql
excel
ios
azure
docker
Or search from our full list:
- javascript
- python
- java
- c\#
- php
- android
- html
- jquery
- c++
- css
- ios
- sql
- mysql
- r
- reactjs
- node.js
- arrays
- c
- asp.net
- json
- python-3.x
- .net
- ruby-on-rails
- sql-server
- swift
- django
- angular
- objective-c
- excel
- pandas
- angularjs
- regex
- typescript
- ruby
- linux
- ajax
- iphone
- vba
- xml
- laravel
- spring
- asp.net-mvc
- database
- wordpress
- string
- flutter
- postgresql
- mongodb
- wpf
- windows
- xcode
- amazon-web-services
- bash
- git
- oracle-database
- spring-boot
- dataframe
- azure
- firebase
- list
- multithreading
- docker
- vb.net
- react-native
- eclipse
- algorithm
- powershell
- macos
- visual-studio
- numpy
- image
- forms
- scala
- function
- vue.js
- performance
- twitter-bootstrap
- selenium
- winforms
- kotlin
- loops
- dart
- express
- hibernate
- sqlite
- matlab
- python-2.7
- shell
- rest
- apache
- entity-framework
- android-studio
- csv
- maven
- linq
- qt
- dictionary
- unit-testing
- asp.net-core
- facebook
- apache-spark
- tensorflow
- file
- swing
- class
- unity-game-engine
- sorting
- date
- authentication
- go
- symfony
- t-sql
- opencv
- matplotlib
- .htaccess
- google-chrome
- for-loop
- datetime
- codeigniter
- perl
- http
- validation
- sockets
- google-maps
- object
- uitableview
- xaml
- oop
- visual-studio-code
- if-statement
- cordova
- ubuntu
- web-services
- email
- android-layout
- github
- spring-mvc
- elasticsearch
- kubernetes
- selenium-webdriver
- ms-access
- ggplot2
- user-interface
- parsing
- pointers
- google-sheets
- c++11
- security
- machine-learning
- google-apps-script
- ruby-on-rails-3
- templates
- flask
- nginx
- variables
- exception
- sql-server-2008
- gradle
- debugging
- tkinter
- delphi
- listview
- jpa
- asynchronous
- web-scraping
- haskell
- pdf
- jsp
- ssl
- amazon-s3
- google-cloud-platform
- testing
- jenkins
- xamarin
- wcf
- batch-file
- generics
- npm
- ionic-framework
- network-programming
- unix
- recursion
- google-app-engine
- mongoose
- visual-studio-2010
- .net-core
- android-fragments
- assembly
- animation
- math
- svg
- rust
- session
- intellij-idea
- hadoop
- join
- curl
- winapi
- django-models
- laravel-5
- next.js
- url
- heroku
- http-redirect
- tomcat
- google-cloud-firestore
- inheritance
- webpack
- gcc
- image-processing
- swiftui
- keras
- asp.net-mvc-4
- logging
- dom
- matrix
- pyspark
- actionscript-3
- button
- post
- optimization
- firebase-realtime-database
- web
- jquery-ui
- cocoa
- xpath
- iis
- d3.js
- javafx
- firefox
- xslt
- internet-explorer
- caching
- select
- asp.net-mvc-3
- opengl
- events
- asp.net-web-api
- plot
- dplyr
- encryption
- magento
- stored-procedures
- search
- amazon-ec2
- ruby-on-rails-4
- memory
- canvas
- multidimensional-array
- audio
- random
- jsf
- vector
- redux
- cookies
- input
- facebook-graph-api
- flash
- indexing
- xamarin.forms
- arraylist
- ipad
- cocoa-touch
- data-structures
- video
- model-view-controller
- azure-devops
- serialization
- apache-kafka
- jdbc
- razor
- woocommerce
- awk
- routes
- servlets
- mod-rewrite
- excel-formula
- beautifulsoup
- filter
- iframe
- docker-compose
- design-patterns
- aws-lambda
- text
- visual-c++
- django-rest-framework
- cakephp
- mobile
- android-intent
- struct
- react-hooks
- methods
- groovy
- mvvm
- lambda
- ssh
- checkbox
- time
- ecmascript-6
- grails
- google-chrome-extension
- installation
- cmake
- sharepoint
- shiny
- spring-security
- jakarta-ee
- plsql
- android-recyclerview
- core-data
- types
- sed
- meteor
- android-activity
- bootstrap-4
- activerecord
- websocket
- graph
- replace
- group-by
- scikit-learn
- vim
- file-upload
- boost
- junit
- memory-management
- sass
- async-await
- import
- deep-learning
- error-handling
- eloquent
- dynamic
- soap
- dependency-injection
- silverlight
- layout
- apache-spark-sql
- charts
- deployment
- browser
- gridview
- svn
- while-loop
- google-bigquery
- vuejs2
- highcharts
- dll
- ffmpeg
- view
- foreach
- makefile
- plugins
- redis
- c\#-4.0
- reporting-services
- jupyter-notebook
- unicode
- merge
- reflection
- https
- server
- google-maps-api-3
- twitter
- oauth-2.0
- extjs
- terminal
- axios
- pip
- split
- cmd
- pytorch
- encoding
- django-views
- collections
- database-design
- hash
- netbeans
- automation
- ember.js
- data-binding
- build
- tcp
- pdo
- sqlalchemy
- apache-flex
- entity-framework-core
- concurrency
- mysqli
- command-line
- spring-data-jpa
- printing
- react-redux
- java-8
- lua
- html-table
- neo4j
- ansible
- service
- jestjs
- enums
- parameters
- flexbox
- material-ui
- module
- promise
- visual-studio-2012
- outlook
- web-applications
- firebase-authentication
- uwp
- webview
- jquery-mobile
- utf-8
- datatable
- python-requests
- parallel-processing
- colors
- drop-down-menu
- scipy
- scroll
- tfs
- hive
- count
- syntax
- ms-word
- twitter-bootstrap-3
- ssis
- fonts
- rxjs
- constructor
- google-analytics
- file-io
- paypal
- three.js
- powerbi
- graphql
- cassandra
- discord
- graphics
- compiler-errors
- gwt
- react-router
- socket.io
- backbone.js
- memory-leaks
- solr
- url-rewriting
- datatables
- nlp
- terraform
- oauth
- datagridview
- drupal
- zend-framework
- oracle11g
- triggers
- knockout.js
- neural-network
- interface
- django-forms
- angular-material
- casting
- jmeter
- google-api
- linked-list
- path
- timer
- arduino
- django-templates
- orm
- proxy
- directory
- windows-phone-7
- parse-platform
- visual-studio-2015
- cron
- conditional-statements
- push-notification
- functional-programming
- primefaces
- pagination
- model
- jar
- xamarin.android
- hyperlink
- uiview
- vbscript
- visual-studio-2013
- google-cloud-functions
- azure-active-directory
- gitlab
- jwt
- download
- swift3
- sql-server-2005
- process
- pygame
- configuration
- rspec
- properties
- callback
- combobox
- windows-phone-8
- linux-kernel
- safari
- scrapy
- permissions
- emacs
- x86
- clojure
- scripting
- raspberry-pi
- io
- scope
- azure-functions
- expo
- compilation
- responsive-design
- mongodb-query
- nhibernate
- angularjs-directive
- reference
- request
- binding
- bluetooth
- dns
- architecture
- playframework
- pyqt
- 3d
- version-control
- discord.js
- doctrine-orm
- package
- f\#
- rubygems
- get
- sql-server-2012
- autocomplete
- tree
- openssl
- datepicker
- kendo-ui
- jackson
- yii
- controller
- grep
- nested
- xamarin.ios
- static
- null
- transactions
- statistics
- datagrid
- active-directory
- dockerfile
- uiviewcontroller
- webforms
- sas
- discord.py
- computer-vision
- phpmyadmin
- notifications
- duplicates
- mocking
- pycharm
- youtube
- yaml
- nullpointerexception
- menu
- blazor
- sum
- plotly
- bitmap
- visual-studio-2008
- asp.net-mvc-5
- floating-point
- css-selectors
- yii2
- stl
- electron
- android-listview
- jsf-2
- time-series
- cryptography
- ant
- hashmap
- character-encoding
- stream
- msbuild
- asp.net-core-mvc
- sdk
- google-drive-api
- jboss
- selenium-chromedriver
- joomla
- devise
- navigation
- cors
- cuda
- anaconda
- frontend
- background
- multiprocessing
- binary
- pyqt5
- camera
- iterator
- linq-to-sql
- mariadb
- onclick
- android-jetpack-compose
- ios7
- microsoft-graph-api
- android-asynctask
- rabbitmq
- tabs
- amazon-dynamodb
- laravel-4
- environment-variables
- uicollectionview
- insert
- linker
- xsd
- coldfusion
- console
- continuous-integration
- upload
- textview
- ftp
- opengl-es
- macros
- operating-system
- mockito
- localization
- formatting
- xml-parsing
- json.net
- vuejs3
- type-conversion
- data.table
- kivy
- timestamp
- integer
- calendar
- segmentation-fault
- android-ndk
- prolog
- drag-and-drop
- char
- crash
- jasmine
- geometry
- automated-tests
- azure-pipelines
- dependencies
- fortran
- android-gradle-plugin
- itext
- mfc
- sprite-kit
- header
- attributes
- nosql
- firebase-cloud-messaging
- format
- nuxt.js
- odoo
- db2
- jquery-plugins
- event-handling
- julia
- jenkins-pipeline
- leaflet
- annotations
- flutter-layout
- nestjs
- keyboard
- postman
- textbox
- arm
- visual-studio-2017
- stripe-payments
- gulp
- libgdx
- uikit
- synchronization
- timezone
- azure-web-app-service
- dom-events
- xampp
- wso2
- crystal-reports
- google-sheets-formula
- namespaces
- aggregation-framework
- swagger
- android-emulator
- jvm
- uiscrollview
- sequelize.js
- chart.js
- com
- snowflake-cloud-data-platform
- subprocess
- geolocation
- webdriver
- html5-canvas
- garbage-collection
- sql-update
- centos
- dialog
- concatenation
- numbers
- widget
- qml
- tuples
- set
- java-stream
- mapreduce
- ionic2
- smtp
- windows-10
- android-edittext
- rotation
- modal-dialog
- nuget
- spring-data
- radio-button
- doctrine
- http-headers
- grid
- lucene
- sonarqube
- xmlhttprequest
- listbox
- initialization
- switch-statement
- internationalization
- components
- boolean
- apache-camel
- google-play
- gdb
- serial-port
- ios5
- ldap
- return
- youtube-api
- pivot
- latex
- eclipse-plugin
- tags
- frameworks
- containers
- c++17
- github-actions
- subquery
- dataset
- asp-classic
- embedded
- foreign-keys
- label
- uinavigationcontroller
- delegates
- copy
- google-cloud-storage
- struts2
- migration
- protractor
- base64
- uibutton
- queue
- find
- sql-server-2008-r2
- arguments
- composer-php
- append
- jaxb
- stack
- zip
- tailwind-css
- cucumber
- autolayout
- ide
- entity-framework-6
- iteration
- popup
- r-markdown
- windows-7
- vb6
- airflow
- g++
- clang
- ssl-certificate
- hover
- jqgrid
- range
- gmail
Next
You’ll be prompted to create an account to view your personalized homepage.
1. 1. [Home](https://stackoverflow.com/)
2. [Questions](https://stackoverflow.com/questions)
3. [AI Assist](https://stackoverflow.com/ai-assist)
4. [Tags](https://stackoverflow.com/tags)
5. [Challenges](https://stackoverflow.com/beta/challenges)
6. [Chat](https://chat.stackoverflow.com/rooms/259507/stack-overflow-lobby)
7. [Articles](https://stackoverflow.blog/contributed?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=so-blog&utm_content=experiment-articles)
8. [Users](https://stackoverflow.com/users)
9. [Companies](https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav)
10. [Collectives]()
11. Communities for your favorite technologies. [Explore all Collectives](https://stackoverflow.com/collectives-all)
2. Stack Internal
Stack Overflow for Teams is now called **Stack Internal**. Bring the best of human thought and AI automation together at your work.
[Try for free](https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) [Learn more](https://stackoverflow.co/internal/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams)
3. [Stack Internal]()
4. Bring the best of human thought and AI automation together at your work. [Learn more](https://stackoverflow.co/internal/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact)
##### Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
[Learn more about Collectives](https://stackoverflow.com/collectives)
**Stack Internal**
Knowledge at work
Bring the best of human thought and AI automation together at your work.
[Explore Stack Internal](https://stackoverflow.co/internal/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact-popover)
# [JQuery: if div is visible \[duplicate\]](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible)
[Ask Question](https://stackoverflow.com/questions/ask)
Asked
9 years, 1 month ago
Modified [5 years, 7 months ago](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible?lastactivity "2020-05-21 14:40:34Z")
Viewed 159k times
This question shows research effort; it is useful and clear
97
Save this question.
Show activity on this post.
**This question already has answers here**:
[How do I check if an element is hidden in jQuery?](https://stackoverflow.com/questions/178325/how-do-i-check-if-an-element-is-hidden-in-jquery) (67 answers)
Closed 9 years ago.
I'm using JS as a way of changing the content of an SPA I'm creating. When I press a button to change the content the HTML changes from this:
```
Copy<div id="selectDiv" style="display: none;">
```
to this:
```
Copy<div id="selectDiv" style>
```
Now part of my SPA has a div that contains a number of checkboxes, each representing a div, and so when I press the submit button, the next div that should be displayed will be the first item in the checkbox list that was selected.
I'm wondering if there's a way in JQuery for the code to "almost detect" which div is now visible. something like this:
```
Copy
```
Any suggestions?
- [javascript](https://stackoverflow.com/questions/tagged/javascript "show questions tagged 'javascript'")
- [jquery](https://stackoverflow.com/questions/tagged/jquery "show questions tagged 'jquery'")
- [html](https://stackoverflow.com/questions/tagged/html "show questions tagged 'html'")
- [css](https://stackoverflow.com/questions/tagged/css "show questions tagged 'css'")
- [checkbox](https://stackoverflow.com/questions/tagged/checkbox "show questions tagged 'checkbox'")
[Share](https://stackoverflow.com/q/40468981 "Short permalink to this question")
Share a link to this question
Copy link
[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/ "The current license for this post: CC BY-SA 4.0")
[Improve this question](https://stackoverflow.com/posts/40468981/edit)
Follow
Follow this question to receive notifications
[edited May 21, 2020 at 14:40](https://stackoverflow.com/posts/40468981/revisions "show all edits to this post")
[](https://stackoverflow.com/users/863110/mosh-feu)
[Mosh Feu](https://stackoverflow.com/users/863110/mosh-feu)
29\.5k1818 gold badges9494 silver badges142142 bronze badges
asked Nov 7, 2016 at 15:38
[](https://stackoverflow.com/users/6778282/mark)
[Mark](https://stackoverflow.com/users/6778282/mark)
1,66311 gold badge1212 silver badges3030 bronze badges
4
- Could you not mess around with the `.hasClass` function to do something like this? Check if an element has a certain class and then go from there?
Andy Holmes
– [Andy Holmes](https://stackoverflow.com/users/1477407/andy-holmes "8,107 reputation")
2016-11-07 15:40:47 +00:00
[Commented Nov 7, 2016 at 15:40](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible#comment68182298_40468981)
- `if(document.getElementById("selectDiv").style.display !== "none"){...}`
Scott Marcus
– [Scott Marcus](https://stackoverflow.com/users/695364/scott-marcus "66,043 reputation")
2016-11-07 15:41:23 +00:00
[Commented Nov 7, 2016 at 15:41](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible#comment68182327_40468981)
- What do you mean by "almost detect"? You could use \$elem.is(":visible") to determine is the element is visible\!
Gacci
– [Gacci](https://stackoverflow.com/users/719554/gacci "1,398 reputation")
2016-11-07 15:42:08 +00:00
[Commented Nov 7, 2016 at 15:42](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible#comment68182363_40468981)
- check this one - [stackoverflow.com/a/72112111/14229690](https://stackoverflow.com/a/72112111/14229690)
Sahil Thummar
– [Sahil Thummar](https://stackoverflow.com/users/14229690/sahil-thummar "2,616 reputation")
2022-05-04 11:38:41 +00:00
[Commented May 4, 2022 at 11:38](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible#comment127415606_40468981)
[Add a comment](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible "Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.") \|
## 1 Answer 1
Sorted by:
[Reset to default](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible?answertab=scoredesc#tab-top)
This answer is useful
146
Save this answer.
Show activity on this post.
You can use [`.is(':visible')`](http://api.jquery.com/visible-selector/)
> Selects all elements that are visible.
For example:
```
Copyif($('#selectDiv').is(':visible')){
```
Also, you can get the div which is visible by:
```
Copy$('div:visible').callYourFunction();
```
Live example:
```
Copy
```
```
Copy
```
```
Copy
```
Run code snippet
Edit code snippet
Hide Results
Copy to answer
Expand
[Share](https://stackoverflow.com/a/40469041 "Short permalink to this answer")
Share a link to this answer
Copy link
[CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/ "The current license for this post: CC BY-SA 3.0")
[Improve this answer](https://stackoverflow.com/posts/40469041/edit)
Follow
Follow this answer to receive notifications
[edited Nov 7, 2016 at 15:49](https://stackoverflow.com/posts/40469041/revisions "show all edits to this post")
answered Nov 7, 2016 at 15:41
[](https://stackoverflow.com/users/863110/mosh-feu)
[Mosh Feu](https://stackoverflow.com/users/863110/mosh-feu)
29\.5k1818 gold badges9494 silver badges142142 bronze badges
Sign up to request clarification or add additional context in comments.
## 8 Comments
Add a comment
[](https://stackoverflow.com/users/1387174/serlite)
Serlite
[Serlite](https://stackoverflow.com/users/1387174/serlite)
[Over a year ago](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible#comment68182449_40469041)
Hey there - not disputing the correctness of this answer, but please consider suggesting or voting on a dupe for questions like these. There are already some pretty comprehensive answers that exist on Stack Overflow that we can point this question to instead.
2016-11-07T15:44:11.773Z+00:00
2
Reply
- Copy link
[](https://stackoverflow.com/users/6778282/mark)
Mark
[Mark](https://stackoverflow.com/users/6778282/mark)
[Over a year ago](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible#comment68182544_40469041)
Could I do something like this? \$(document).ready(function () { if (\$('\#selectDiv').is(':visible')) { //JS code associated with this div. } });
2016-11-07T15:46:27.05Z+00:00
0
Reply
- Copy link
[](https://stackoverflow.com/users/863110/mosh-feu)
Mosh Feu
[Mosh Feu](https://stackoverflow.com/users/863110/mosh-feu)
[Over a year ago](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible#comment68182679_40469041)
Yes, see my update.
2016-11-07T15:49:53.123Z+00:00
0
Reply
- Copy link
[](https://stackoverflow.com/users/863110/mosh-feu)
Mosh Feu
[Mosh Feu](https://stackoverflow.com/users/863110/mosh-feu)
[Over a year ago](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible#comment68183920_40469041)
@JacksonSentzke any thoughts?
2016-11-07T16:20:49.217Z+00:00
0
Reply
- Copy link
[](https://stackoverflow.com/users/6778282/mark)
Mark
[Mark](https://stackoverflow.com/users/6778282/mark)
[Over a year ago](https://stackoverflow.com/questions/40468981/jquery-if-div-is-visible#comment68184117_40469041)
It runs in the code snippet, but it's not running in my code. It's now just trial and error to get it working.
2016-11-07T16:26:21.403Z+00:00
0
Reply
- Copy link
Add a comment
\|
Show 3 more comments
Start asking to get answers
Find the answer to your question by asking.
[Ask question](https://stackoverflow.com/questions/ask)
Explore related questions
- [javascript](https://stackoverflow.com/questions/tagged/javascript "show questions tagged 'javascript'")
- [jquery](https://stackoverflow.com/questions/tagged/jquery "show questions tagged 'jquery'")
- [html](https://stackoverflow.com/questions/tagged/html "show questions tagged 'html'")
- [css](https://stackoverflow.com/questions/tagged/css "show questions tagged 'css'")
- [checkbox](https://stackoverflow.com/questions/tagged/checkbox "show questions tagged 'checkbox'")
See similar questions with these tags.
- The Overflow Blog
- [The 2025 Stack Overflow and Stack Exchange wrap—our top ten questions of the...](https://stackoverflow.blog/2025/12/17/the-2025-stack-overflow-and-stack-exchange-wrap/?cb=1 "The 2025 Stack Overflow and Stack Exchange wrap—our top ten questions of the year!")
- [Last week in AWS re:Invent with Corey Quinn](https://stackoverflow.blog/2025/12/19/last-week-in-aws-re-invent-with-corey-quinn/?cb=1)
- Featured on Meta
- [Native Ads coming soon to Stack Overflow and Stack Exchange](https://meta.stackexchange.com/questions/415259/native-ads-coming-soon-to-stack-overflow-and-stack-exchange?cb=1)
- [A proposal for bringing back Community Promotion & Open Source Ads](https://meta.stackexchange.com/questions/416429/a-proposal-for-bringing-back-community-promotion-open-source-ads?cb=1)
- [Policy: Generative AI (e.g., ChatGPT) is banned](https://meta.stackoverflow.com/questions/421831/policy-generative-ai-e-g-chatgpt-is-banned?cb=1)
- [Stack Overflow chat opening up to all users in January; Stack Exchange chat...](https://meta.stackoverflow.com/questions/437778/stack-overflow-chat-opening-up-to-all-users-in-january-stack-exchange-chat-late?cb=1 "Stack Overflow chat opening up to all users in January; Stack Exchange chat later")
- [Modernizing curation: A proposal for The Workshop and The Archive](https://meta.stackoverflow.com/questions/437757/modernizing-curation-a-proposal-for-the-workshop-and-the-archive?cb=1)
Community activity
Last 1 hr
- Users online activity
10990 users online
- 16 questions
- 15 answers
- 29 comments
- 153 upvotes
Popular tags
[c](https://stackoverflow.com/questions/tagged/c)[python](https://stackoverflow.com/questions/tagged/python)[r](https://stackoverflow.com/questions/tagged/r)[.net](https://stackoverflow.com/questions/tagged/.net)[c\#](https://stackoverflow.com/questions/tagged/c)[java](https://stackoverflow.com/questions/tagged/java)
Popular unanswered question
[Feature branching using git subrepos](https://stackoverflow.com/questions/61606259)
[git](https://stackoverflow.com/questions/tagged/git)[git-subrepo](https://stackoverflow.com/questions/tagged/git-subrepo)
[](https://stackoverflow.com/users/2155605)
[Ogen](https://stackoverflow.com/users/2155605)
- 6\.7k
2,057 days ago
#### Linked
[8741](https://stackoverflow.com/questions/178325/how-do-i-check-if-an-element-is-hidden-in-jquery?lq=1 "Question score (upvotes - downvotes)")
[How do I check if an element is hidden in jQuery?](https://stackoverflow.com/questions/178325/how-do-i-check-if-an-element-is-hidden-in-jquery?noredirect=1&lq=1)
[559](https://stackoverflow.com/questions/8774089/detect-if-an-element-is-visible-with-jquery?lq=1 "Question score (upvotes - downvotes)")
[Detect if an element is visible with jQuery](https://stackoverflow.com/questions/8774089/detect-if-an-element-is-visible-with-jquery?noredirect=1&lq=1)
[2](https://stackoverflow.com/questions/51840877/jquery-javascript-detect-if-woocommerce-store-notice-html-is-visible?lq=1 "Question score (upvotes - downvotes)")
[jQuery / Javascript - Detect if WooCommerce store notice html is visible](https://stackoverflow.com/questions/51840877/jquery-javascript-detect-if-woocommerce-store-notice-html-is-visible?noredirect=1&lq=1)
[1](https://stackoverflow.com/questions/58095340/scroll-to-part-of-page-where-first-validation-failed-message-is-showing?lq=1 "Question score (upvotes - downvotes)")
[Scroll to part of page where first validation failed message is showing](https://stackoverflow.com/questions/58095340/scroll-to-part-of-page-where-first-validation-failed-message-is-showing?noredirect=1&lq=1)
[0](https://stackoverflow.com/questions/56570630/how-to-start-this-jquery-counter-only-when-its-containing-div-appears-onscreen?lq=1 "Question score (upvotes - downvotes)")
[How to start this JQuery counter only when its containing DIV appears onscreen?](https://stackoverflow.com/questions/56570630/how-to-start-this-jquery-counter-only-when-its-containing-div-appears-onscreen?noredirect=1&lq=1)
#### Related
[5230](https://stackoverflow.com/questions/901712/how-do-i-check-whether-a-checkbox-is-checked-in-jquery?rq=1 "Question score (upvotes - downvotes)")
[How do I check whether a checkbox is checked in jQuery?](https://stackoverflow.com/questions/901712/how-do-i-check-whether-a-checkbox-is-checked-in-jquery?rq=1)
[8741](https://stackoverflow.com/questions/178325/how-do-i-check-if-an-element-is-hidden-in-jquery?rq=1 "Question score (upvotes - downvotes)")
[How do I check if an element is hidden in jQuery?](https://stackoverflow.com/questions/178325/how-do-i-check-if-an-element-is-hidden-in-jquery?rq=1)
[4608](https://stackoverflow.com/questions/426258/setting-checked-for-a-checkbox-with-jquery?rq=1 "Question score (upvotes - downvotes)")
[Setting "checked" for a checkbox with jQuery](https://stackoverflow.com/questions/426258/setting-checked-for-a-checkbox-with-jquery?rq=1)
[3165](https://stackoverflow.com/questions/31044/is-there-an-exists-function-for-jquery?rq=1 "Question score (upvotes - downvotes)")
[Is there an "exists" function for jQuery?](https://stackoverflow.com/questions/31044/is-there-an-exists-function-for-jquery?rq=1)
[3080](https://stackoverflow.com/questions/596351/how-can-i-know-which-radio-button-is-selected-via-jquery?rq=1 "Question score (upvotes - downvotes)")
[How can I know which radio button is selected via jQuery?](https://stackoverflow.com/questions/596351/how-can-i-know-which-radio-button-is-selected-via-jquery?rq=1)
[2854](https://stackoverflow.com/questions/90178/make-a-div-fill-the-height-of-the-remaining-screen-space?rq=1 "Question score (upvotes - downvotes)")
[Make a div fill the height of the remaining screen space](https://stackoverflow.com/questions/90178/make-a-div-fill-the-height-of-the-remaining-screen-space?rq=1)
[2706](https://stackoverflow.com/questions/1575141/how-to-make-a-div-100-height-of-the-browser-window?rq=1 "Question score (upvotes - downvotes)")
[How to make a div 100% height of the browser window](https://stackoverflow.com/questions/1575141/how-to-make-a-div-100-height-of-the-browser-window?rq=1)
[2731](https://stackoverflow.com/questions/6677035/scroll-to-an-element-with-jquery?rq=1 "Question score (upvotes - downvotes)")
[Scroll to an element with jQuery](https://stackoverflow.com/questions/6677035/scroll-to-an-element-with-jquery?rq=1)
[2534](https://stackoverflow.com/questions/450903/how-can-i-make-a-div-not-larger-than-its-contents?rq=1 "Question score (upvotes - downvotes)")
[How can I make a div not larger than its contents?](https://stackoverflow.com/questions/450903/how-can-i-make-a-div-not-larger-than-its-contents?rq=1)
#### [Hot Network Questions](https://stackexchange.com/questions?tab=hot)
- [Can an SO8 SMD IC be desoldered and soldered with only soldering station, solder, wick and pliers?](https://electronics.stackexchange.com/questions/763455/can-an-so8-smd-ic-be-desoldered-and-soldered-with-only-soldering-station-solder)
- [Is there a measure of astronomical distance that is not Earth-specific?](https://astronomy.stackexchange.com/questions/62023/is-there-a-measure-of-astronomical-distance-that-is-not-earth-specific)
- [What is magic item rarity good for with homebrew items?](https://rpg.stackexchange.com/questions/218359/what-is-magic-item-rarity-good-for-with-homebrew-items)
- [Which training structure is better for me?](https://bicycles.stackexchange.com/questions/99851/which-training-structure-is-better-for-me)
- [Font "not loadable: metric data not found or bad"](https://tex.stackexchange.com/questions/757384/font-not-loadable-metric-data-not-found-or-bad)
- [Rendering Queried Video Previews as a Real-Time ASCII Animation in Python](https://codereview.stackexchange.com/questions/300805/rendering-queried-video-previews-as-a-real-time-ascii-animation-in-python)
- [Who is the "messenger on Nassau Avenue" in the poem "In the Beginning, There Was the Word"?](https://literature.stackexchange.com/questions/31229/who-is-the-messenger-on-nassau-avenue-in-the-poem-in-the-beginning-there-was)
- [When do we have to use comma after the adverb "seulement"](https://french.stackexchange.com/questions/58413/when-do-we-have-to-use-comma-after-the-adverb-seulement)
- [What is an English idiom for the Urdu expression often used when a person is overconcerned about something that shouldn't really concern them](https://english.stackexchange.com/questions/638269/what-is-an-english-idiom-for-the-urdu-expression-often-used-when-a-person-is-ove)
- [Why light Shabbos candles before menorah?](https://judaism.stackexchange.com/questions/154501/why-light-shabbos-candles-before-menorah)
- [Is it morally correct to feint sadness for the sake of others?](https://buddhism.stackexchange.com/questions/55208/is-it-morally-correct-to-feint-sadness-for-the-sake-of-others)
- [Which terminal is displayed in the cold war bunker at York?](https://retrocomputing.stackexchange.com/questions/32348/which-terminal-is-displayed-in-the-cold-war-bunker-at-york)
- [How to start Witcher 2 on a system having a lot of CPU cores? E.g. 16 cores and 32 threads?](https://gaming.stackexchange.com/questions/417419/how-to-start-witcher-2-on-a-system-having-a-lot-of-cpu-cores-e-g-16-cores-and)
- [What is the proper way to install an external circlip with no eyelets?](https://bicycles.stackexchange.com/questions/99848/what-is-the-proper-way-to-install-an-external-circlip-with-no-eyelets)
- [Understanding how bench power supply works (CC vs CV)](https://electronics.stackexchange.com/questions/763363/understanding-how-bench-power-supply-works-cc-vs-cv)
- [Is there any way for developed countries to stop China from engaging in indirect support for Russia through large-scale purchases of natural gas?](https://politics.stackexchange.com/questions/93974/is-there-any-way-for-developed-countries-to-stop-china-from-engaging-in-indirect)
- [PSE Advent Calendar 2025 (Day 21): A Christmas Crime](https://puzzling.stackexchange.com/questions/136385/pse-advent-calendar-2025-day-21-a-christmas-crime)
- [SWAP gate for qutrits](https://quantumcomputing.stackexchange.com/questions/45892/swap-gate-for-qutrits)
- [Proving uniqueness of solution of a differential equation](https://math.stackexchange.com/questions/5116022/proving-uniqueness-of-solution-of-a-differential-equation)
- [The Ship of Theseus applied to brains](https://philosophy.stackexchange.com/questions/134631/the-ship-of-theseus-applied-to-brains)
- [Can a character with one dot of blood potency walk around in daylight?](https://rpg.stackexchange.com/questions/218351/can-a-character-with-one-dot-of-blood-potency-walk-around-in-daylight)
- [Can one be absolutely certain of a hypothesis without being dogmatic?](https://philosophy.stackexchange.com/questions/134583/can-one-be-absolutely-certain-of-a-hypothesis-without-being-dogmatic)
- [36 numbers around a circle](https://puzzling.stackexchange.com/questions/136365/36-numbers-around-a-circle)
- [Can't remove a single switch box in the wall](https://diy.stackexchange.com/questions/328190/cant-remove-a-single-switch-box-in-the-wall)

default
# Why are you flagging this comment?
Probable spam.
This comment promotes a product, service or website while [failing to disclose the author's affiliation](https://stackoverflow.com/help/promotion).
Unfriendly or contains harassment/bigotry/abuse.
This comment is unkind, insulting or attacks another person or group. Learn more in our [Abusive behavior policy](https://stackoverflow.com/conduct/abusive-behavior).
Not needed.
This comment is not relevant to the post.
```
```
Enter at least 6 characters
Something else.
A problem not listed above. Try to be as specific as possible.
```
```
Enter at least 6 characters
Flag comment
Cancel
You have 0 flags left today
# 
# Hang on, you can't upvote just yet.
You'll need to complete a few actions and gain 15 reputation points before being able to upvote. **Upvoting** indicates when questions and answers are useful. [What's reputation and how do I get it?](https://stackoverflow.com/help/whats-reputation)
Instead, you can save this post to reference later.
Save this post for later
Not now
##### [Stack Overflow](https://stackoverflow.com/)
- [Questions](https://stackoverflow.com/questions)
- [Help](https://stackoverflow.com/help)
- [Chat](https://chat.stackoverflow.com/?tab=explore)
##### [Business](https://stackoverflow.co/)
- [Stack Internal](https://stackoverflow.co/internal/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams)
- [Stack Data Licensing](https://stackoverflow.co/data-licensing/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=data-licensing)
- [Stack Ads](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising)
##### [Company](https://stackoverflow.co/)
- [About](https://stackoverflow.co/)
- [Press](https://stackoverflow.co/company/press/)
- [Work Here](https://stackoverflow.co/company/work-here/)
- [Legal](https://stackoverflow.com/legal)
- [Privacy Policy](https://stackoverflow.com/legal/privacy-policy)
- [Terms of Service](https://stackoverflow.com/legal/terms-of-service/public)
- [Contact Us](https://stackoverflow.com/contact)
- Cookie Settings
- [Cookie Policy](https://policies.stackoverflow.co/stack-overflow/cookie-policy)
##### [Stack Exchange Network](https://stackexchange.com/)
- [Technology](https://stackexchange.com/sites#technology)
- [Culture & recreation](https://stackexchange.com/sites#culturerecreation)
- [Life & arts](https://stackexchange.com/sites#lifearts)
- [Science](https://stackexchange.com/sites#science)
- [Professional](https://stackexchange.com/sites#professional)
- [Business](https://stackexchange.com/sites#business)
- [API](https://api.stackexchange.com/)
- [Data](https://data.stackexchange.com/)
- [Blog](https://stackoverflow.blog/?blb=1)
- [Facebook](https://www.facebook.com/officialstackoverflow/)
- [Twitter](https://twitter.com/stackoverflow)
- [LinkedIn](https://linkedin.com/company/stack-overflow)
- [Instagram](https://www.instagram.com/thestackoverflow)
Site design / logo © 2025 Stack Exchange Inc; user contributions licensed under [CC BY-SA](https://stackoverflow.com/help/licensing) . rev 2025.12.19.38237 |
| Readable Markdown | null |
| Shard | 169 (laksa) |
| Root Hash | 714406497480128969 |
| Unparsed URL | com,stackoverflow!/questions/40468981/jquery-if-div-is-visible s443 |