This JavaScript shows a very simple example of how to create a button that does something JavaScript-like in nature when it is clicked. The alert() function is predefined: we could have made our own function and then called it upon the onClick event.