logo
← 返回面试题库

What is the output that is printed when the div containing the text "Click Here" is clicked? <pre><code>//HTML Markup &lt;div id=&quot;A&quot;&gt; &lt;div id=&quot;B&quot;&gt; &lt;div id=&quot;C&quot;&gt;Click Here&lt;/div&gt; &lt;/div&gt;&lt;/div&gt;</code></pre> <pre><code>//JavaScriptdocument.querySelectorAll(&#x27;div&#x27;).forEach((e) =&gt; { e.onclick = (e) =&gt; console.log(e.currentTarget.id);});</code></pre>

中等javascriptweb-development

想查看完整答案?

登录匠人学院学习中心,获取 STAR 格式回答和详细技术解析

前往学习中心查看答案