So i have started some javascript and i wanted to ask that is there a way to select elements in an array. I read the querySelector, querySelectorAll and getElementsByClassName but these select the entire array but not the elements in it. Because i want to add event listener to elements so that delete button removes the list item. If my code is like this:-
<body>
<h3>Simple Add/Remove Task</h3>
<h4>To do List</h4>
<ul>
<div>
<li>Wake up</li>
<li>Study</li>
</div>
<div>
<button>Delete</button><br>
<button>Delete</button>
</div>
</ul>
<script type="text/javascript" src="./script.js"></script>
</body>