Question: On my website, users click on an image. However, in the code they're actually clicking on an `<a>` with an `<img>` in it. I want there to appear a red ring around the image when the user clicks it. The `<img>` and the `<a>` have the same id and class.

Is it possible to have `$(this).addClass('SelectedService');` add a class to an `<img>` inside an `<a>`?

Answer: 
No need to go for the jquery use css

Your html

```
<img src="http://static.adzerk.net/Advertisers/12f0cc69cd9742faa9c8ee0f7b0d210e.jpg"/>

```

and css

```
img:active
{
    border:3px solid red;

}

```

**[Demo](http://jsfiddle.net/JPYYu/)**

Checkout upper link for the demo
```
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>    
$('#id_link').click(function(){
   $(this).toggleClass('SelectedService');
});

```

assuming that class is a red ring