How can I render JavaScript objects to HTML with pure JavaScript or jQuery?
data = {
'this-is-title-123' : {
title : 'this-is-title-123',
content : 'Lorem ipsum dolor sit amet',
date : '12.8.2009'
},
'this-is-title-456' : {
title : 'this-is-title-456',
content : 'the quick brown fox jumped',
date : '18.2.2028'
},
'this-is-title-789' : {
title : 'this-is-title-789',
content : 'the jumped fox fell in a pit',
date : '19.12.2020'
}
}
I want to convert it to HTML like this:
<div>
<h1>this-is-title-123</h1>
<p>Lorem ipsum dolor sit amet</p>
<p>12.8.2009</p>
</div>
<div>
<h1>this-is-title-456</h1>
<p>the quick brown fox jumped</p>
<p>18.2.2028</p>
</div>
<div>
<h1>this-is-title-789</h1>
<p>the jumped fox fell in a pit</p>
<p>19.12.2020</p>
</div>