Computer Science, asked by Kokilaa, 11 months ago

What is an alert box? Write one code for javascript to display an alert box.​

Answers

Answered by Niruru
11
\bf {What \: is \: an \: Alert \:Box?}

An alert box is often used if you want to make sure information comes through to the user. When an alert box pops up, the user will have to click "OK" to proceed.


\bf {Syntax :-}

window.alert ("sometext");

_______________________ _ _

\bf {Coding :-}

<html>

<body>

<p>Click the button to display an alert box</p>

<button onclick="myFunction()"> Try it </button>

<script>

function myFunction()

{

alert ("Hello world!");

}

</script>

</body>

</html>
______________________ _ _

Kokilaa: Thank you Stager!
Niruru: Your welcome dear!^^
Answered by RaghuSB
2

<html>

<body>

<p>Click the button to display an alert box</p>

<button onclick="myFunction()"> Try it </button>

<script>

function myFunction()

{

alert ("I'm an alert box");

}

</script>

</body>

</html>

Similar questions