add an alert when button is clicked javascript code example Example: simple alert program in javascript alert("this is the alert")