Display Alert in JavaScript

In the below example, We can show an alert in JavaScript.

<!DOCTYPE html>
<html>
<body>
<p>Display alert in javascript</p>
<p>Give Your Details</p>
First name:<br>
<input type="text" id="txtFirstName" name="firstname">
<br>
Last name:<br>
<input type="text" name="lastname" id="txtLastName">
<br>
<br>
<button onclick="showAlert()" id=btnSubmit>Submit</button>
<script>
function showAlert() {
alert("Created Account");
}
</script>
</body>
</html>

Top 51 JavaScript Example: Display alert in javascript

Give Your Details

First name:

Last name:


Leave a Reply

Your email address will not be published. Required fields are marked *