Property values ​​in a CSS div jQuery

This is a very basic tip, basically consists in knowing what the value of a CSS property, through jQuery.

For example:

#div{display: none}

To know the value of this div in jQuery, addresses the following code statement:


var value = $('#div').css('display');
if(value == 'none'){
/*What you do*/
}else{
/*What you do*/
}

Until next time.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s