-2
Good evening, I have a problem, because the next code does not work:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="app">
<div class="box"></div>
</div>
<script>
var boxElement = document.querySelector('.box');
boxElement.style.width = 100;
boxElement.style.height = 100;
boxElement.style.backgroundColor = '#f00';
</script>
</body>
</html>
It was supposed to give a result like this:
The console reports nothing, no errors. And it seems to be all right.
It was the first thing I tried. I heard that in this case n need return measure,but still tried with px and n was.
– Lucas RM
had put single quotes?
– Marcos ACR
No, good, so it was. ?
– Lucas RM
Because you might have seen jss (pre-css processor) tutorial or something of the genre, and not js, maybe if you shared more information from where you saw it, we could give a more objective answer to the pq so it didn’t work
– MarceloBoni