javascript – How to detect which js file is being used by an element class?

Question:

I'm trying to check which files can be used by a given element's class. Example:

<script src="arquivo1.js"></script>
<script src="arquivo2.js"></script>
<script src="arquivo3.js"></script>
<script src="arquivo4.js"></script>
<script src="arquivo5.js"></script>

<div class="classe1">...</div>

Assuming the div has jquery effects that use its "class1" class, how would I know, which of the files above has (creates) this effect? Tried through element inspector but couldn't.

I intend to do this because I have a really cool effect and I want to do exactly the same as the file I have, but there's a lot and I couldn't figure out how the particular effect works.

Answer:

You can search within files for $(".classe1") or document.getElementByClass("classe1") .

You can also comment out all the other files leaving only one uncommented, or comment one by one checking if the effect stops happening.

<! --
<script src="arquivo1.js"></script>
<script src="arquivo2.js"></script>
<script src="arquivo3.js"></script>
<script src="arquivo4.js"></script>
-->
<script src="arquivo5.js"></script>
Scroll to Top