Here are a few examples on what javascript can be used for, for example changing color or making images bigger when pressing them.
For example: Pressing the "click me" button will give you a prompt to type in a color. This will result in the text on the page changing color.
Pressing the images will make them bigger so you can see them better and pressing outside of the image will put it away.
If you then reload the page the changes will go away.