Skip to content

[js]事件委托考察 #17

Description

@f2ebill
<ul>
  <li class='target'>
      <span>test</span>
 </li>
</ul>
  • 点击classtargetli可以 alert 出其所含内容(如上方代码点击弹出“test”)
  • ul动态新增li元素的情况下,也要有相同效果
  • 使用原生js实现,不使用jQuery

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions