Translate

Monday, May 5, 2014

9.Creating Function

How to create Function
common forms

function function_name(var1,var2,...,varN){
  function definition
}
example

















The above example, we have a function called welcome ().This function works when we click on the button Click me. So that we function when we click the button we use attribute onclick by to attribute onlick equal to the name of the function that we want to process.

function return value
example
៩. ការ​បង្កើត Function
Life 's value in JavaScript If we declare a value in the function , it can be used only in Function , it can not be used outside . When we left the Function value will be lost . Such value called the Local Variable. If we declare a value outside the function , it can be used in our page as a whole . Such value is called the Global Variable. Life 's value as Global until page is closed after it is gone .

0 comments:

Post a Comment