0

I keep getting Uncaught ReferenceError: $ is not defined in Chrome. Also, tried including the js file just after the closing body tag but doesn't work.

HTML code:

<head>
<title>Task 7 | Jquery</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
    <script type="text/javascript" src="jquery/userlist.js"></script>

</head>
<body>

    <input id="filter" type="text" placeholder="Search" />

 </body>

JQuery script:

$(document).ready(function () {  // getting the error here
$('#filter').click(function () {
    $("#filter").hide();
});
});
Komal Waseem
  • 1,089
  • 3
  • 17
  • 24

1 Answers1

1

You are getting that error because you did not include the jQuery Library.

Download jQuery and add it same way you added jquery/userlist.js before.

<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript" src="jquery/userlist.js"></script>
Jerry U
  • 618
  • 9
  • 22
HungryCoder
  • 7,506
  • 1
  • 38
  • 51