admin管理员组文章数量:1290946
I found in my university website there is a button to add course. Where can I find the function addNewCourseToStudent()
details using inspect element of the google chrome.
<button onclick="addNewCourseToStudent()">Add</button>
I found in my university website there is a button to add course. Where can I find the function addNewCourseToStudent()
details using inspect element of the google chrome.
<button onclick="addNewCourseToStudent()">Add</button>
- look on script tags in the html / php file from that button or in js files included in that file.. – Walter Cejas Commented Mar 29, 2020 at 7:36
2 Answers
Reset to default 5An inline handler will almost certainly be referencing a global variable, so you can open the console and log the variable, which will give you the function location and its code:
const foo = 'some code';
function fn() {
console.log('fn running');
}
// when you have the function name, console.dir it
// to find its location:
console.dir(fn);
// console.log it to find its code:
console.log(fn);
You can click on the link to the right of the [[FunctionLocation]]
to get to the place in the Sources panel where the function is defined.
Right click inspect the tag or button,
Choose the Event Listeners Tab in the developer tools as shown below
Expand click
it won't show as onclick it will show as click
版权声明:本文标题:javascript - Where can I find the function called by onclick using Inspect Element of Chrome? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741516566a2382924.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论