Example#1:Create a multiplication table asking the user the number of rows and columns he wants.
Solution:
Solution:
Example#2: Create a form that collects the first name, last name, email, user id, password and confirm 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, display proper error messages in red color just next to the textbox where there is an error.
Solution:
Example#3: Display a message "Welcome!!!" on your webpage and when the user hovers over the message, a popup should be displayed with a message "Welcome to my WebPage!!!".
Solution:
53
| <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>
|