html - How can I tell which javascript script added a specific class to my source code -


let's source html looks this:

<div id="whatever">...</div> 

but chrome inspector shows me like:

<div id="whatever" class="random-class">...</div> 

i can assume that .random-class added javascript script, there dozens of these scripts on site. there "standard" way, using chrome or firebug inspector example, determine script adding class element?

with webkit inspector in chrome, can use ctrl-shift-f , search "random-class". give matches, distincted file.

you can go through results 1 one , find cause, put breakpoints. if of pain can try find classname += "random-class" or jquery addclass("random-class") etc.

if looking @ results in minified code, chrome allows prettify result, after can re-search. if have minified file 1 line function x() { document.body.classname += "random-class"; };x();document.body.classname += "random-class"; match show 1 line. prettify code , re-search. results show in 2 different lines.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -