Code skill Making buttons run code

In this piece of code you can see how you can add an onclick attribute to an <input> tag to make a button run a JavaScript function when it is clicked. Here the JavaScript function creates an alert to remind Professor Bairstone to hire the security team. The value of the onclick attribute in the <input> tag is set to call the JavaScript function. So when the button is clicked, the JavaScript function will run.

See the Pen M3 CS Making buttons run code by Walker Books UK (@walkerbooks) on CodePen.