And it does this:
Very cool, right? Just a button changing some text using JS! Nothing great but pretty Awesome 🙂
We first made JS understand that btn is the button which we click and txt is the paragraph tag containing some text which should change when the button is clicked.
We then added an EventListener to btn so we know as soon as it gets clicked. And that triggers the code inside the function.
That code checks if txt is Awesome, make it Not Awesome and vice versa! That’s all 🙂