how to display an event in Alert() method java code example Example 1: javascript alert alert("string"); Example 2: javascript alert alert(varible);