Implementing functions in Java Script

0
1002

In this session today we will study the FUNCTIONS in an java script.

  • To understand the functions in java script follow the steps given below :

  1. For passing a parameter in the function ,lets take an example, so write the following code in Notepad++ or any other text editor :

  2. So your Notepad++ window will have the following look after writing the code :
  3. v1

  4. When you open it in the browser you will have the following output :
  5. v2

  6. Let’s have another example of function which will display a message on the button click event :

  7. Hence after writting the code you editor window will have the following look :
  8. 3.1

  9. When you open it in the browser you will get the following output :
  10. v4

  11. Now lets have an example to call a function with arguments on the button click ,so write the given code in Notepad++ editor :

  12. After writing the code your Notepad++ window will have the following look :
  13. v5

  14. Now when you open it in the browser you will get the following output :
  15. v6

  16. Thus, we have implemented functions with paramaters in javascript .

LEAVE A REPLY

Please enter your comment!
Please enter your name here