Trying to get a CSS element into JavaScript to animate it but it just isn't working.
HTML (index.html)
<script src="bruh.js"></script>
<link rel="stylesheet" href="style.css">.
...
<div class="circle">
</div>
CSS (style.css)
.circle {
background-color: blue;
width: 100px;
height: 100px;
border-radius: 50%;
}
JS (bruh.js)
const element = document.querySelector('.circle');
const style = getComputedStyle(element);
console.log(style);
Console:
Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.