....... html stuff....
<script type='text/javascript'>
function checkuser() {
alert("This is a test");
var user = document.getElementById("user").value;
}
</script>
........ more HTML .......
<input type='button' value='click me' name='hahaha' onclick='checkuser()' />
Of course my code has more detail than that, but the event handler is not firing and the alert() is not executing as well.
Im looking for any reasons why this will not fire:
Erm.. it works for me... I copied and pasted your code into notepad, save as HTML file, ran it and it worked perfectly. It's likely your other html that is causing it to not fire.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Is there a relation between the location of the function def and the spelling of the event handler?
No, provided that the entire page has loaded. Spelling... yes. OnClick, onclick, and onClick will work.. but onlckick won't.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.