LearnFast.Ninja

JavaScript alert box onload

On JavaScript area write alert then write the string message you want to display. Test the working example that pop up alert box using body onload.

Step 1: On JavaScript area write alert then write the string message you want to display. 

alert('Click OK to continue');


Working example that pop up alert box using body onload: 

<html>

<head>

    <title>Alert Box</title>

</head>

<body onload="alert('Click OK to continue');">

    This is some text.

</body>

</html>


Result:


Tags

javascript

alert