Skip to content Skip to sidebar Skip to footer

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

<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"