How do you call function in javascript?

Questions by parthoaccy

Showing Answers 1 - 12 of 12 Answers

Code
  1. <script language="javascript" type="text/javascript">

  2. //Declare Function

  3. function a() {

  4. ??? alert("function called");

  5. }

  6. //call function from the script it self

  7. a();

  8. </script>

  9.  

  10. //call function on button click

  11. <input type="button" onclick="a()"/>

  Was this answer useful?  Yes

IRS786

  • Aug 10th, 2008
 

For example:

Code
  1.  

  2. <html>

  3. <head>

  4. <script type="javascript">

  5. function call() {

  6.    alert{"are you calling me!"};

  7. }

  8. </script>

  9. </head>

  10. <body>

  11. <form>

  12.   <input type="button" onclick="call()" value="call">

  13. </form>

  14. </body>

  15. </html>

  Was this answer useful?  Yes

Ranjan Kumar

  • Sep 22nd, 2011
 

Code
  1.  

  2. function CollFunction()

  3. {

  4. alert("ok")

  5. }

  6.  

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions