题解 | #事件委托#
事件委托
https://www.nowcoder.com/practice/02866b3ce7f8420c8b5d22f483c5fcc0
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
</head>
<body>
<ul>
<li>.</li>
<li>.</li>
<li>.</li>
</ul>
<script type="text/javascript">
// 补全代码
let ul2=document.getElementsByTagName("ul");
ul2[0].addEventListener("click",(elem)=>{
elem.target.innerHTML+=".";
})
</script>
</body>
</html>