Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery: Check whether an Element is Hidden from the user

Tags:

jquery

How to check whether a particular element is hidden from the user? In my code, under certain conditions, this code will be called:

$("#VersionSelectField").hide('fast'); 

So I have to make sure that if $("#VersionSelectField") is hidden, then I would not have to validate the value inside it when I submit the form ( I use JQuery Validate library for this purpose).

Any ideas?

like image 683
Graviton Avatar asked Jul 06 '09 04:07

Graviton


2 Answers

$("#VersionSelectField").is(':hidden'); 
like image 67
user120242 Avatar answered Sep 28 '22 08:09

user120242


This works for me:

$("#VersionSelectField").css("display") == "none"; 
like image 23
Mark A. Nicolosi Avatar answered Sep 28 '22 08:09

Mark A. Nicolosi