please have a look at following question and answer, the seccond answer (with the many upvotes) 
[Jquery: How to check if the element has certain css class/style](https://stackoverflow.com/questions/759631/jquery-how-to-check-if-the-element-has-certain-css-class-style)

looks like this:

```
if ($('#yourElement').css('position') == 'absolute') {
    // true
}

```

so this is awesome but I would like something like

```
if ($('#yourElement').css('position') == 'absolute') {
    $(this).addClass('xxx');
}

```

so the element with the ID "yourElement" gets a class added

what is the easyest way to do that