If we are writing some code using jQuery and want to know if a particular element in your page is visible or hidden you can do that using is() method,
Code Example:
<div id="hiddenEle" name="hiddenEle" style="display:none">This div is hidden</div>
<div id="visibleEle" name="visibleEle" style="display:block">This div is visible</div>
console.log($('#hiddenEle').is(":visible"));
console.log($('#visibleEle').is(":visible"));
Output:
false
true
βοΈjsfiddle: https://jsfiddle.net/0wxy8ect/4/
More Posts related to jQuery,
- jQuery: Check if an element exists or not
- [jQuery] Uncaught ReferenceError: $ is not defined at index.html:5
- Make div element draggable using jQuery
- jQuery : Move to top of the page
- Dynamically Obtaining Browser Screen Width and Height with jQuery [Updated 2023]
- How to check if an element is hidden using jQuery code?
- Redirect page using jQuery
- Disable jQuery button after being click
More Posts:
- [Fix] zsh: command not found: awscli [Mac Terminal] - AWS
- Download Google Chrome setup exe file using PowerShell - Powershell
- New-SPLogFile PowerShell - create new SharePoint log file - SharePoint
- Two Ways to Extract rar (*.rar) files on Mac - MacOS
- Check version of pip package installer for Python - Python
- SharePoint - Use Today's Date Time in list view filter and calculated column - SharePoint
- Notepad++ Save Failed - Please check if this file is opened in another program. - NotepadPlusPlus
- How to fix Microsoft Windows 10 update error 80070020 - Microsoft