Hi I have a problem with my code. I want to set display: block when i click on "start" button. I created addevenlistener on click but something is wrong. Can anyone to help me?
const ulElement = document.querySelectorAll("li");
const btn = document.querySelector("button");
function changeSize() {
ulElement.style.display = "block";
}
btn.addEventListener("click", changeSize);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>list</title>
<style>
li {
display: none;
}
</style>
</head>
<body>
<button>Start</button>
<ul>
<li>element 1</li>
<li>element 2</li>
<li>element 3</li>
<li>element 4</li>
<li>element 5</li>
<li>element 6</li>
<li>element 7</li>
<li>element 8</li>
<li>element 9</li>
<li>element 10</li>
</ul>
<script src="main.js"></script>
</body>
</html>