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:
Similar questions