How to see the properties of a DOM element as they change in realtime?

Posted by allquixotic on Super User See other posts from Super User or by allquixotic
Published on 2012-11-14T21:12:57Z Indexed on 2012/11/14 23:04 UTC
Read the original article Hit count: 219

JavaScript code can update the properties/attributes of DOM elements in real time by responding to events and so on. Here is an example.

In the table on that page, move your mouse over the cells. Notice how they change color when the mouse is on them, and the color goes away when you move the mouse to another cell.

Now, using Firefox or Chrome (but not IE, Opera, etc.), I want to examine the background color, expressed in RGB or hex or whatever, of the cells updated in real time, as the mouse cursor enters and leaves the region and causes the JS to do its thing.

The behavior that I observe, currently, is that the Inspect Element functionality of both Firefox and Chrome does not update the value of the properties as they are updated by JavaScript. So, in order to view the latest value of the property, I have to inspect the element again, and it takes a momentary "snapshot" of the values. But since the values only change while I have the mouse on them, I can't take a snapshot of the value I want while my mouse cursor is over the cell, because I have to remove my mouse from the cell to select the "Inspect Element" item in the right-click list!

If it is possible to have the values updated in real time using either Firefox or Chrome, or an extension, on any recent version of the software (up to the latest stable), please provide instructions for doing so.

© Super User or respective owner

Related posts about firefox

Related posts about google-chrome