Question: I need to have a if/else statement inside a function. How do you check if an element (e.g. #cadrage) has a display style property? This is what I have found around the net and yet, it is not working..

```
if( $('#cadrage').attr('style').display == 'block' ) {
      // do something
} else {
      // do something
}

```

Answer: 
The jQuery .css() function seems to be what you want.

```
if( $('#cadrage').css('display') == 'block' ) {
   console.log('It equal block');
} else {
   console.log('It did not equal block');
}

```

<http://jsfiddle.net/SamMonk/FtP6W/>
You can get your element display property with the following code snippet

```
$('#cadrage').css('display');

```

Note that the `css` method can return any css property of your element so it is very handy.
Therefore your statement code will be:

```
if( $('#cadrage').css('display').display == 'block' ) {
      // do something
} else {
      // do something
}

```