Save display output

I am troubleshooting a script.
How do I save the orange output from the display above?

Any suggestions?

Thanks.

There probably is a better way, but I use

right-click > Copy > Outer HTML

Then paste somewhere.

1 Like

Thanks for the response.

Are you referring to copying just html?

I am troubleshooting a scrolling script.

The data (in orange) I am referring to is a continual stream of data containing display, visibility, padding and other properties as it scrolls down the page.

I want to capture all of it.

1 Like

Oh.

Have you already tried logging it to the console or otherwise accumulating it somewhere as you are changing it? Or you could add a mutation observer on the element, but that probably involves more overhead.

1 Like

I could only find ways to log errors or information.

1 Like

Information sounds useful. :slight_smile:

Is your script setting the position? If so, can you emit the data to the console using console.log() from that same part of your script?

1 Like

Can you tell me how to do that?

1 Like

I don’t know what your code looks like, but let’s say there is a block of code where you set position data. Then you could

console.log(document.getElementById(‘header’).getAttribute(‘style’));

to output the stuff highlighted in orange to the console. It might be a tiny bit faster to output data the script already has instead of having to go to the DOM, but it probably would be a little bit more work to code it up.

1 Like

I will give it a try. Thanks!!

1 Like