Easy learning with example program codes

Javascript alert dialog box example

Javascript alert dialog box is used to display a warning message to the users.
Note: Alert dialog box gives one button “OK”.


<!DOCTYPE html>
function giveWarning() {
   alert("Warning message.");
   document.write ("Warning message.");
<p>Click Submit button and see result.</p>      
 <input type="button" onclick="giveWarning()" value="Submit" />

Try it:

JS Bin on

Sign Up/ Sign In
Ask a Question

Copyright © 2018 CodesJava Protection Status SiteMap Reference: Java Wiki