জাভাস্ক্রিপ্টে একটি বোতামের ক্লিকে একটি ফাংশন কল করতে, অনক্লিক ব্যবহার করুন। JavaScript-
-এ একটি ফাংশন অনক্লিক কল করতে নিম্নলিখিত কোডটি চালানোর চেষ্টা করুনউদাহরণ
<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>