0

Does anyone know how to change a DOM element to an object, and change the object back to DOM element?

I want to convert a DOM element to an object and convert it to JSON using JSON.stringify.

Anyone know how to do this? Many thanks.

skirtle
  • 27,868
  • 4
  • 42
  • 57
mack873
  • 323
  • 1
  • 2
  • 6
  • Possible duplicate of [replace specific tag name javascript](https://stackoverflow.com/questions/15086677/replace-specific-tag-name-javascript) – Mathieu VIALES Oct 22 '17 at 09:05
  • can you please give an example about what problem are u facing?? – Apoorv Oct 22 '17 at 09:05
  • 2
    What?! Everything in the DOM is an `Element` , which is automatically an `Object`. If you dont believe me enter `new Element instanceof Object` ... – Jonas Wilms Oct 22 '17 at 09:05
  • Hi Jonas w and Apoorv , i want convert a dom element to an object and convert to json by json.stringify – mack873 Oct 22 '17 at 09:09

0 Answers0