My website uses a nav bar which toggles divs on and off to go to different "pages". Recently the buttons have stopped responding (nothing happens when clicked, and nothing appears in the console), and I have not been able to figure out why.
My nav bar is formatted like so:
<a href="#" id="videosButton">videos</a><br>
<a href="#" id="graphicButton">graphic design</a><br>
<a href="#" id="webButton">web design</a><br>
My pages are formatted like so:
<div id="videos" class="page">Videos page</div>
The JS is:
$('#videosButton').click(function () {
document.body.style.backgroundColor="rgb(192,57,43)"
$(".page").hide();
$('#videos').show();
});
for each button. My JS file is being loaded, and I can view it in the console, so it's not an issue with that. I have been struggling with this for hours and I am at a loss. Can anybody help me understand why the nav bar is not behaving as expected?
EDIT: I have moved my external JS and jQuery to just before the closing </body>
tag, and the problem persists. I have put up the complete website at http://hdf.bl.ee/test/index.html if anyone thinks there is an issue not in the code I posted.
` - it's still right in the `head` of your page and it's not wrapped in DOM ready function.
– Roko C. Buljan Aug 25 '15 at 01:52