JavaScript Function:-

 JavaScript Function:-


- Function is a small job program 

- function separator 

- Function terminology 

1)function Defination:-

create a function is called function defination

2) function calling:-

when user can use the function is called function calling

- how to create a function in javascript:-


Inside javascript all function is to be created using function keyword


function name()

{

 statement


 }


all statement inside the function is called container statement 


function display()

{


}

 


How to access function:-


-Access function inside the javascript using button control

-Inside the button control we have to use on click event 


<html>

<head>

<script langauge="JavaScript">

  

  function display()

  {

    document.write("Welcome");

   }


</script>

</head>

<body>

 <button onclick="display()">Submit</button>

 

</body>

</html> 


How to access multiple function in single button:-


<html>

<head>

<script langauge="JavaScript">

  

  function display()

  {

    document.write("Welcome");

    document.write("<br>");

    show();

   }

  


   function show()

   {

   document.write("Nagpur");

   }

</script>

</head>

<body>

 <button onclick="display()">Submit</button>

 

</body>

</html> 



Task1:-

salary program into function



Comments

Popular posts from this blog

HTML FORMS

condition management IF, ELSE, ELSEIF

HTML NOTES