admin管理员组文章数量:1394990
When i'm in any website, how can i use Chrome Developer Tools to find out what JS function is called when i click on an element ?
For instance, i'm on a website that has a DIV element. When i click on this DIV, it will do some actions. I want to know what JS function do these actions, so i am able to call this JS function programatically in the console, without need to manually click on the DIV.
Thanks !
When i'm in any website, how can i use Chrome Developer Tools to find out what JS function is called when i click on an element ?
For instance, i'm on a website that has a DIV element. When i click on this DIV, it will do some actions. I want to know what JS function do these actions, so i am able to call this JS function programatically in the console, without need to manually click on the DIV.
Thanks !
Share Improve this question asked Feb 5, 2016 at 16:20 delphirulesdelphirules 7,50818 gold badges69 silver badges131 bronze badges 1- 1 Possible duplicate of How to find what code is run by a button/element in Chrome using Developer Tools – isherwood Commented Feb 5, 2016 at 16:31
1 Answer
Reset to default 5All the event listeners for an element are shown in the Event Listeners panel. If you expand the 'click' event section you'll see what scripts are at play.
Once you've found a likely script, expand its object to see function names (except, of course, for anonymous functions) and other properties.
本文标签: javascriptChrome Developer ToolsHow to know the event triggered when click a elementStack Overflow
版权声明:本文标题:javascript - Chrome Developer Tools : How to know the event triggered when click a element? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744107517a2591134.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论