0

Is it possible to add a JavaScript object which is found while debugging, to the DOM for future reference? (It is okay to keep it in any place where retrievable. DOM is just a suggestion. Storing and retrieving needs to be done using a debugging tool.)

(Sample usage:pass as a argument by retrieving it from DOM while calling to a function using console.)

Note : This is not about how to add a JavaScript Object to the DOM within JS code. I'm aware that it can be done using methods mentioned here.

Don D
  • 726
  • 1
  • 9
  • 19
  • In what form do you want this object in the DOM? – Nick Oct 14 '17 at 18:02
  • Why not using the global object window? Should the value be stored for a specific element? Please elaborate. – Sagi Oct 14 '17 at 18:02
  • @snapjs Assume this is not a simple object. So I want to keep at as a JavaScript object as it is rather than a String. – Don D Oct 14 '17 at 18:05
  • @Sagi I just want to store it globally, not for a specific element. Can you explain further how to add it to the global object window using developer tools since the object can only be found while debugging – Don D Oct 14 '17 at 18:08
  • 3
    Just open the developer tools, peek the console and type window.yourProp = yourValue – Sagi Oct 14 '17 at 18:12
  • Also if debugging in browser console can store right in console ( right click) – charlietfl Oct 14 '17 at 18:16
  • It is the answer I'm looking for. Thanks @Sagi – Don D Oct 14 '17 at 18:17
  • @charlietfl I'm using firefox developer tools and there's no such an option. – Don D Oct 14 '17 at 18:27
  • there is in firefox developer version...haven't looked at standard version for long time – charlietfl Oct 14 '17 at 18:30

0 Answers0