Tutorialspoint examples

Learn java tutorial with examples for beginners online

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 jsbin.com

Download tutorialspointexamples Android App
Copyright © 2018 Tutorialspoint examples DMCA.com Protection Status