So imagine I received this string back from my server:
'<h1>hello everyone</h1>'
How can I turn this string into actual HTML that I can insert into my document?
So imagine I received this string back from my server:
'<h1>hello everyone</h1>'
How can I turn this string into actual HTML that I can insert into my document?
Try it:
var response = '<h1>hello everyone</h1>';
document.getElementById('localContainer').innerHTML = response;
// or
document.write(response);
<div id="localContainer"></div>