Javascript click event listener on multiple elements and get target ID

前端 未结 6 1304
轻奢々
轻奢々 2020-12-01 22:06

I have a javascript file that sets an EventListener of \'click\' on every element with the

tag. I want to get the id of the article clicked when
6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-01 22:12

    This mini javascript libary (1.3 KB) can do all these things

    https://github.com/Norair1997/norjs/

    nor.event(["#first"], ["touchstart", "click"], [doSomething, doSomething]);
    

    This plugin can handle such stuff and more

提交回复
热议问题