I try to select a certain DOM element with jQuery.
The HTML content:
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </script>
</head>
<body>
<nav id="nav" class="navigator">
<h1>Nav Header</h1>
<ul class="nav-list">
<li class="nav-item"><a >Item #1</a></li>
<li class="nav-item active"><a href="#2">Item #2</a></li>
</ul>
</nav>
</body>
</html>
I want to select Item #1. I used
$('.nav-list').children()
I got
TypeError: $(...).children is not a function
What's wrong here?
$()
function by default, but it is not jQuery.$
is defined to bedocument.getElementById
there, by default.