Javascript – How To find out what is hiding/acting on a html element

debuggingjavascriptjquery

I have a simple <a> tag that is getting hidden from some JS. (display:none)
I have looked into the page source and I can see it is not hidden, however the inspector shows it as display:none ( inline style )

No result finding out the class/id in JS code in order to isolate the part of the code that is hiding the <a>.

Is there a tool or fixed procedure that can help me to debug this?

Best Solution

Chrome lets you break code when an attribute on an element is changed.

  1. Open the developer tools using F12, and select the "Elements" tab. Find the element that gets hidden. Right click on it, "Break on", "Attributes Modification".

  2. Refresh the page, keeping Developer Tools open.

If the element is being hidden using JavaScript, you'll break at that point.

Otherwise, it's done via CSS. If this is the case, using the "Elements" tab again, select the element you're interested in and look at the "Styles" applied to it in the right hand column. Chrome will show which styles are applied by which definition in which stylesheet. It should then be trivial to find the one hiding the element.

enter image description here