Để gọi hàm JS như một function độc lập, chỉ cần gọi tên hàm kèm dấu ngoặc đơn.
Ví dụ
<html>
<head>
<script>
function Display() {
document.write("Hello World!");
}
</script>
</head>
<body>
<p>Nhấn nút để gọi hàm</p>
<form>
<input type="button" onclick="Display()" value="Display">
</form>
</body>
</html>