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: 
Your code doesn't work because `style` property only contains inline styles, not those coming from a stylesheet.

To get the computed style, you can use [`css`](http://api.jquery.com/css/#css1) method:

```
$('#cadrage').css('display') == 'block'

```
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
}

```