html as json code example
Example 1: html to json
fetch('https://www.example.com/index.html')
.then(res => res.text())
.then(html => console.log(html));
Example 2: json object in html page
mainContainer.appendChild(div);
fetch('https://www.example.com/index.html')
.then(res => res.text())
.then(html => console.log(html));
mainContainer.appendChild(div);