I have a html defined like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
...
</head>
<body>
<div id="nav">
<a href="/">home</a> |
{% if user.is_authenticated %}
<a href="/save/">submit</a> | <a href="/user/{{ user.username}}/"{{ user.username }}</a> | <a href="/logout/">logout</a>
{% else %}
<a href="/login">login</a> | <a href="/register/">register</a>
{% endif %}
</div>
</body>
</html>
In Firebug Console I type the following to hide the nav class:
$("#nav").hide()
But when I run it I get this error message:
TypeError: $("#nav") is null
$("#nav").hide() with(_...e() }; (line 2)
nav is clearly there, I can even see it in the HTML tab of Firebug, what am I missing?
Thanks
You’re missing jQuery
Add
Between the
<head></head>tags.