return
|
|
The return keyword will exit the existing function and return a value. |
<html> <body> <script language="JavaScript"> <!-- function getValue(){ var myValue = 4*3; return myValue; } function fill(){ var x = getValue(); document.form1.tmp.value = x; } --> </script> <form name="form1"> Value: <input type="text" Name="tmp" Size=5> <br> <br> <input type="button" name="get" value="Get Returned Value" onClick='fill()'> <br> <br> </form> </body> </html>
|
|
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
|