give full explanation to how to create alert in js using function script
Answers
Answered by
2
<html><body>
<h2>JavaScript Confirm Box</h2>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>function myFunction() { var txt; if (confirm("Press a button!") == true) { txt = "You pressed OK!"; } else { txt = "You pressed Cancel!"; } document.getElementById("demo").innerHTML = txt;}</script>
</body></html>
<h2>JavaScript Confirm Box</h2>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>function myFunction() { var txt; if (confirm("Press a button!") == true) { txt = "You pressed OK!"; } else { txt = "You pressed Cancel!"; } document.getElementById("demo").innerHTML = txt;}</script>
</body></html>
Answered by
1
Answer:
hope it was helpful for more qualified answers please follow me
written by#sypraveen
Attachments:
![](https://hi-static.z-dn.net/files/d6a/f25641c95e09da6ee011b69084f37c30.jpg)
Similar questions
Computer Science,
9 months ago
Math,
9 months ago
Math,
9 months ago
History,
1 year ago
Math,
1 year ago