JS.Events.FunctionalizeEventprocess
<!DOCTYPE html>
<html>
<body>
<p>Click the button to display the date.</p>
<!-- Javascript code is usually many lines long, its better to -->
<!-- be called by a function-->
<button onclick="displayDate()">The time is?</button>
<script>
function displayDate() {
document.getElementById("demo").innerHTML = Date();
}
</script>
<p id="demo"></p>
</body>
</html>