Question: So, I followed an online course from [www.code.org](https://code.org/) to accomodate myself with JavaScript. I used elements such as `setProperty();` and `onEvent();`. I used an online editor to add a button and the following code to change the button's text when the user clicks it:

```
onEvent("button1","click", function()
 {
  setProperty("button1","text","Hello there!");
 });

```

My question is: How can I do this thing in HTML, by using the `<button>` tag?

Answer: 
HTML  

`<button id="but" onclick="clickme()">click me </button>`

JS

```
<script>
function clickme(){
document.getElementById("but").innerHTML = "changed";
}
</script>

```
You can add id to your button, for example:

```
<button id="myButton">Click!</button>

```

And then in javascript:

1. select the element.

```js
document.getElementById("myButton");

```

2. add the event handler to it, so the code would become like this:

```js
document.getElementById("myButton").onclick = function() {
     myFunction()
};

```

3. describe the event

```js
function myFunction() {
    document.getElementById("myButton").innerHTML = "YOU CLICKED ME!";
}

```