We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
03-javascript基础中的32节-事件委托中的最后一串代码: // 获取父节点,并为它注册click事件。 false 表示事件在冒泡阶段触发(默认) document.getElementById("parent-list").addEventListener("click", function (e) { // event.target 代表的是子元素。toUpperCase 指的是转换为大写字母 if (e.target && e.target.nodeName.toUpperCase == "LI") { // 真正的处理过程在这里 console.log("List item ", e.target.id, " was clicked!"); } }, false); 中的toUpperCase后应加括号,否则js事件绑定失败
// 获取父节点,并为它注册click事件。 false 表示事件在冒泡阶段触发(默认) document.getElementById("parent-list").addEventListener("click", function (e) { // event.target 代表的是子元素。toUpperCase 指的是转换为大写字母 if (e.target && e.target.nodeName.toUpperCase == "LI") { // 真正的处理过程在这里 console.log("List item ", e.target.id, " was clicked!"); } }, false);
The text was updated successfully, but these errors were encountered:
e560734
@ybbbzZ 感谢指正,已修复。国庆节快乐~
Sorry, something went wrong.
fix #59: 将 toUpperCase 改为 toUpperCase()
f8bfdf0
No branches or pull requests
03-javascript基础中的32节-事件委托中的最后一串代码:
// 获取父节点,并为它注册click事件。 false 表示事件在冒泡阶段触发(默认) document.getElementById("parent-list").addEventListener("click", function (e) { // event.target 代表的是子元素。toUpperCase 指的是转换为大写字母 if (e.target && e.target.nodeName.toUpperCase == "LI") { // 真正的处理过程在这里 console.log("List item ", e.target.id, " was clicked!"); } }, false);
中的toUpperCase后应加括号,否则js事件绑定失败
The text was updated successfully, but these errors were encountered: