I'm on chrome on a Mac, and the index file runs but the script doesn't change anything. I tried just removing paragraphs and that doesn't work either. I tried hard refreshing and running from the Live extension.
This is the code from Index.html
<!DOCTYPE html>
<html>
<head>
<h1> I've a lot of things to do today.</h1>
</head>
<body>
<p> 1. Get the litter & Wet Food.</p>
<p> 2. Clean the Room.</p>
<p> 3. Go out with the girlfriend.</p>
<p> 4. Teach Rishabh.</p>
<p> 5. Watch a show.</p>
<p> 6. DON'T GET ANYMORE NFTS SER.</p>
<script scr="scripts.js"></script>
</body>
</html>
and scripts.js
let ps = document.querySelectorAll('p')
ps.forEach(function(p){
p.remove()
})
The script isn't called at all because even a simple console.log statement in the scripts.js file won't run. No errors either :/
Thanks a lot for the help. I'm super new and this has been kinda frustrating.
You can't write
h1like this inhead,headis used for meta-data, link, and other things to configure html page before loading. If you want, you can set atitlein head to replace yourh1or move yourh1in yourbody. Rest of your content should be inbody.Edit : And you have a spell error, it's
srcnot "scr" for import your script !You may run a little
console.log()for ensure your import is fine, before working on script like this, if the log, at top of the js file doesn't not appear in your console browser, the script is probably not imported.