//html tree
let obj = {
body: {
tagName: 'body',
attrs: {},
paired: true,
subTags: [
{
tagName: 'div',
attrs: {},
paired: true,
subTags: [
{
tagName: 'span',
attrs: {},
paired: true,
text: 'Enter data please:',
},
{
tagName: 'br',
paired: false
},
{
tagName: 'input',
attrs: {
type: 'text',
id: 'name'
},
paired: false
},
{
tagName: 'input',
attrs: {
type: 'text',
id: 'surname'
},
paired: false
}
]
},
{
tagName: 'div',
attrs: {},
paired: true,
subTags: [
{
tagName: 'button',
attrs: {
id: 'ok'
},
paired: true,
text: 'Ok'
},
{
tagName: 'button',
attrs: {
id: 'cancel'
},
paired: true,
text: 'Cancel'
},
],
},
]
}
}
console.log(`