+ 1
Attaching the jQuery does not work? Anyway to fix it?
7 ответов
+ 5
Could you post the error?
+ 5
this works for me, try it:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://code.jquery.com/jquery-3.1.1.js"></script>
<script>
$(function() {
var b = $("body");
b.html("hello");
});
</script>
</head>
<body>
</body>
</html>
[edit]:
forgot to close the head tag, now everything works
+ 5
just so it's easy to copy paste, however it's better to put it in the "js" tab
+ 5
lol I'm sorry, looks like I forgot to close the head tag now everything should work fine🖒
+ 2
So you put the jquery script in the html?
+ 1
I just do what is in the course: add the link to the library in the html and then I create a js file and add that to the html as well but if I try to use the dollar sign it says the variable is not assigned
+ 1
tnx I'll try that