1

When I highlight the input on the Chrome browser and then click on "Inspect Element" from right-click menu then Chrome Developer Tools will popup.

Assume in the Chrome Developer Tools, this will appear:

<input type="radio" name="lineType_phone" id="lineType_new" value="new">

When I click on the input, the hidden div will appear. I would like to see how it was coded in JavaScript.

Is there a way to search for name="lineType_phone" or id="lineType_new" in any of JavaScript files or debug click event for this attributes/input?

I'll-Be-Back
  • 10,530
  • 37
  • 110
  • 213
  • 1
    "the hidden div" was just an example. I would like debug what happen when I click on input and see what the code like in javascript – I'll-Be-Back Mar 11 '15 at 23:29
  • you have a tab called "Event Listeners" next to the Syles and Computed tab, that lets you see what files/code is binded to certain events. – André Santos Mar 11 '15 at 23:33

3 Answers3

2

Looking for files might not solve your problem. As sometimes files are minified or events have use lots of variables which means that searching for name="lineType_phone" might not be helpful.

What about searching for events bound to the element?

The code below will show events bound to the element itself

$._data( $("#myElement")[0], "events" ); //don't forget to get the first elem of array

However, some events are added through delegation. That means that the event might be bound to a parent DOM element. If that's the case, try looking for events on the parent like this:

$._data( $("#myElement").parent()[0], "events" );
ThiagoPXP
  • 5,362
  • 3
  • 31
  • 44
0

Firstly, you need to make sure its in javascript.

Some css3 properties can do the :hover {display:block} effect.

Second, in the "source" tab, click the "drawer" button on top right corner (most left one out of 3 right cornered button). as Image Then there is search tab in the below section, I believe you can do a "full text" search on all javascript scripts. as Image

hansW
  • 44
  • 5
0

When you're viewing a Javascript file in the Source tab you can use Ctl-f to search for a string. I don't think there's a way to search all the script files at once, though. You have to do each one separately.

Barmar
  • 741,623
  • 53
  • 500
  • 612