Welcome to the seventeenth Easy JavaScript Tutorial, Beginner JavaScript Tutorial, part of Easy Programming! In this tutorial, we start using buttons! Why? Because we're going to look at the onclick event handler. This will allow us to do many more complex actions with JavaScript because we can now take click-input from users.
There is also an onclick event listener, this is something that we will cover in a later tutorial. If you know how an event handler works, an event listener will be extremely easy.
document.getElementById("id_name").onclick = function(){ //do stuff with the code after element with #id_name was clicked }
To fork the fiddle and follow along: https://jsfiddle.net/easyjs/tu9ax1L2/
Remember to checkout the Resources section below for associated downloadable content, JSFiddle links, and other resources. Watch the video and follow along!