জাভাস্ক্রিপ্ট আমাদের নিজস্ব ফাংশন লেখার অনুমতি দেয়। স্ক্রিপ্টের পরবর্তীতে একটি ফাংশন আহ্বান করতে, আপনাকে শুধু সেই ফাংশনের নাম লিখতে হবে।
উদাহরণ
নিচের কোডটি চালিয়ে জাভাস্ক্রিপ্টে ফাংশন কল করা শিখুন:
<html> <head> <script> function sayHello() { document.write ("Hello there!"); } </script> </head> <body> <p>Click the following button to call the function</p> <form> <input type = "button" onclick = "sayHello()" value = "Say Hello"> </form> <p>Use different text in write method and then try...</p> </body> </html>