Question: I got failed to create the id on that button clicked event. Is this because of the event on that button? Is there any way to create an id on the same button clicked?
Here is my JavaScript function. It doesn't work as expected for me.

```
<div class="DivButton" style="" onclick="divClick()"></div>
function divClick()
{
    $(this).attr("id") =="Active";     
}

```

Thank you

Answer: 
```js
let btn = document.querySelector('DivButton');
btn.setAttribute("id","Active");

```
You can pass `this` into `divClick` function.

```js
function divClick(e){
   e.id = "Active";
   console.log(e);    
}
```

```html
<div class="DivButton" style="" onclick="divClick(this)">a</div>
<div class="DivButton" style="" onclick="divClick(this)">b</div>
<div class="DivButton" style="" onclick="divClick(this)">c</div>
```