题解 | #事件委托#
事件委托
https://www.nowcoder.com/practice/02866b3ce7f8420c8b5d22f483c5fcc0
{"css":"","js":"","html":"<!DOCTYPE html>\n<html>\n <head>\n <meta charset=utf-8>\n </head>\n <body>\n \t<ul>\n <li>.</li>\n <li>.</li>\n <li>.</li>\n </ul>\n\n <script type=\"text/javascript\">\n // 补全代码\n const ul = document.querySelector('ul');\nul.onclick = function(event) {\n if (event.target.tagName === 'LI') {\n event.target.textContent += '.';\n }\n};\n\n </script>\n </body>\n</html>","libs":[]}