Solution:

Multiplication Table

Example#2: JS Forms Example:

Create a sample form program that collects the first name, last name, email, user id, password and confirms password from the user. All the inputs are mandatory and email address entered should be in correct format. Also, the values entered in the password and confirm password textboxes should be the same. After validating using JavaScript, In output display proper error messages in red color just next to the textbox where there is an error. Solution with Source Code:

Form Validation
First Name:
Last Name:
Email:
User Id:
Password:
Confirm Password:

Example#3: POPUP Message using Event:

Display a simple message “Welcome!!!” on your demo webpage and when the user hovers over the message, a popup should be displayed with a message “Welcome to my WebPage!!!”. Solution:

<html>

<head>

<title>Event!!!</title>

<script type="text/javascript">

function trigger()

{

document.getElementById("hover").addEventListener("mouseover", popup);

function popup()

{

alert("Welcome to my WebPage!!!");

}

}

</script>

<style>

p

{

     font-size:50px;

     position: fixed;

     left: 550px;

     top: 300px;

}

</style>

</head>

<body  onload="trigger();">

<p id="hover">Welcome!!!</p>

</body>

</html>