Simple javascript example program
The following example is the very simple javascipt example program, in this example we are placed a html button tag, onclick event and function definition and alert.
html button
This will create a button.
onclick event
The function name call_fun() call the definition when click on the button.
function definition
The function definition have many statements and it will execute line by line.
alert
Example Program:- (Editor)

Editor is Loading...
Advertisement
html button
<input type="button" value="sample button">
This will create a button.
onclick event
onclick="call_fun();"
The function name call_fun() call the definition when click on the button.
function definition
function call_fun()
{
-------
-------
-------
}
The function definition have many statements and it will execute line by line.
alert
alert("Text");
alert box display with the text Text.
Example Program:- (Editor)
Editor is Loading...
Advertisement
Post a Comment for "Simple javascript example program"