Question: I am changing the image on a `UISlider` thumb as follows:

```
[mySlider setThumbImage:thumbRegular forState:UIControlStateNormal];
[mySlider setThumbImage:thumbActive forState:UIControlStateHighlighted];

```

When I scrub, it all works as I expect, but when my finger falls off the thumb while scrubbing (drags outside), the thumb image changes back to "thumbRegular", even though the scrubbing itself continues normally. (And changes back to "thumbActive" as the dragging comes back inside).

Any ideas on how to correct this behaviour? Or is it expected behaviour?

Answer: 
Check out the [jQuery.attr()](http://api.jquery.com/attr/) method.

It can be used to extract the value of any attribute.

In your case, you're after the id attribute:

```
$(this).attr('id');

```

It **can also be used to set** an attribute:

```
$(this).attr('id', 'funkyId');

```

Whenever you have a question, your best bet is to go straight to the jQuery documentation (which is excellent).

I was led straight to the above link when I googled "*jquery get id*".
You need to do this -

```
$(this).attr('id');

```