<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<input type="text" class="input">
<ul class="list">
<li class="lies" name="lies" >Adem</li>
<li class="lies" name="lies" >Adem1</li>
<li class="lies" name="lies" >Adem2</li>
<li class="lies" name="lies" >Adem3</li>
<li class="lies" name="lies" >Adem4</li>
</ul>
<button class="button">Add name</button>
<script>
const listChild = document.querySelectorAll('.lies');
listChild.addEventListener('click', () => {
listChild.parentNode.removeChild('listChild');
});
</script>
</body>
</html>
(我只知道 HTML、css、javascript。所以不要试图用 jquery 来回答。我不会明白)我希望当我点击 li*s 时消失。但代码无法正常工作。