In my example I have a basic tabbed content setup. The buttons have classes that match the divs IDs. onClick, I'd like to grab the className, and find an ID with the same name

[![enter image description here](https://i.stack.imgur.com/2jCkV.png)](https://i.stack.imgur.com/2jCkV.png)

**jQuery:**

```
$("li").click(function() {
   var liClass = this.className;
   $("li").removeClass("active");
   $("#"+liClass).addClass("active"); 
});

```

**jsFiddle:** <https://jsfiddle.net/CSS_Apprentice/kpo7t6xh/>