This is my Javascript:
<script type="text/javascript">
function contactChange() {
var contact = document.getElementbyId("contact");
if (contact.style.display == "none") {
contact.style.display = "block";
} else {
contact.style.display = "none";
}
}
</script>
And here is my site:
It’s
document.getElementById, notdocument.getElementbyId. (In JS, name of variables and functions are case-sensitive)Debugging tip : Look at the JS console (F12 in Google Chrome and IE9, Ctrl+Shift+K in Firefox). In this case, following error can be seen:
It shows where the error happened (line 260 in your HTML/JS code) and what the error is(Object
#<HTMLDocument>has no methodgetElementbyId).