how to alert in js code example Example 1: js alert alert("Hello! I am an alert box!!"); Example 2: javascript alert alert("string");