I am beginner in JavaScript and Html. Currently I am learning to make chrome extensions.
My manifest.json file is like this:
{
"manifest_version": 2,
"name": "Hello World",
"version": "1.0",
"description": "A Hello world extensions",
"icons": {
"128": "128chat.png",
"48": "48chat.png",
"16": "16chat.png"
},
"browser_action": {
"default_icon": "16chat.png",
"default_popup": "popup.html"
}
}
My popup.html file is :
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World</title>
<script src="popup.js"></script>
<script src="jquery-3.5.1.min.js"></script>
</head>
<body>
<h1 id="greet">Hello</h1>
<input type="text" id="name">
</body>
</html>
My popup.js file is :
$(function () {
$('#name').keyup(function () {
$('#greet').text("hello " + $('#name').val());
});
});
I am using "jquery-3.5.1.min.js" jquery file in my project.
But while running extension I am getting "Uncaught Reference Error : $ is not defined"
Can you please tell me what is wrong in my code?