I'm trying to write a program that allows the user to enter any word and then press the button to get the result.
The result is "hello".
Can anyone help me to figure out why the result doesn't appear when I render it?
<head>
<meta charset = "utf-8">
<script>
function start() {
var button = document.getElementById("add" );
button.addEventListener( "click", t, false );
}
function t() {
r.innerHTML = "Hello";
window.addEventListener( "load", start, false );
}
</script>
</head>
Please help if you know what is wrong in my code.