hello I wanted to if there is way to add a javaScript object inside a html tag but i want it to be a type of object not string.
for more clarification, here is an example :
const codeEl = document.querySelector('div')
let obj = {
"test": 1,
"test2": 2
}
codeEl.textContent = JSON.stringify(obj)
the output of the code will be an object with type of string inside an html element. but the thing is that i dont want the object to be converted to a string; i want it actual object type to be displayed inside the html element (for some library usage purposes)