I am trying to write a menu whose subitems vanish when the page is loaded.
If you need full HTML, I will copy it, however it just consists of a bunch of DIVs, the items under the headers have a class of subitems
.
I have managed to do what I need via:
$(document).ready(
$(".subitems").hide()
);
However, in Chrome, despite it working fine, I get the following error in the console:
(Using picture as I can't copy the formatting well)
When I remove the above code, the error goes. I guess I have done something wrong, but I can't see it and so far it works in every browser I have tested.
Any suggestions on either:
- Have I done something wrong?
- Is there a better way to achieve what I want?