জাভাস্ক্রিপ্ট আমাদের নিজস্ব ফাংশনগুলিও লিখতে দেয়৷ স্ক্রিপ্টের পরে কোথাও একটি ফাংশন চালু করতে, আপনাকে কেবল সেই ফাংশনের নাম লিখতে হবে৷
উদাহরণ
জাভাস্ক্রিপ্ট -
-এ কীভাবে একটি ফাংশন কল করতে হয় তা শিখতে আপনি নিম্নলিখিত কোডটি চালানোর চেষ্টা করতে পারেন<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>