Posts

Showing posts with the label Examples on Javascript

Javascript Examples

Example1.html :- <HTML> <HEAD> <SCRIPT LANGUAGE="JavaScript"> function Hello() { alert("Hello,Welcome and  have a good day."); } </SCRIPT> </HEAD> <BODY> <INPUT TYPE="button" NAME="Button" VALUE="Press me" onClick="Hello()"> </BODY> </HTML> Output :- Example2.html :- <HTML> <HEAD> <SCRIPT LANGUAGE="JavaScript"> function Name()     {         var answer = prompt("What is your name?", "");         if (answer)         alert("God bless You, " + answer);     } </SCRIPT> </HEAD> <BODY> <INPUT TYPE="button" NAME="Button" VALUE="Press me" onClick="Name() "> </BODY> </HTML> Output:- Example3.html:- <html> <body> <p>This example calls a function which performs a calculation, and ...