Skip to content

[js]事件委托考察 #17

@f2ebill

Description

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

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