Computer Science, asked by Ankitchotukumar, 1 year ago

give full explanation to how to create alert in js using function script

Answers

Answered by sivasham08
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>
Answered by sypraveen141004
1

Answer:

hope it was helpful for more qualified answers please follow me

written by#sypraveen

Attachments:
Similar questions