how to set an alert on button click in javascript code example Example: simple alert program in javascript alert("this is the alert")