You can render HTML using document.write()
document.write(`This is a <a href="#">link</a>, for a test.`);`
But to append existing HTML string, you need to get the id of the node/tag under which you want to insert your HTML string.
There are two ways by which you can possibly achieve this:
Using DOM -
var tag_id = document.getElementById('tagid');
var newNode = document.createElement('p');
newNode.appendChild(document.createTextNode(`This is a <a href="#">link</a>, for a test.`));
node.appendChild(newNode);
Using innerHTML -
var tag_id = document.getElementById('tagid');
tag_id.innerHTML(`This is a <a href="#">link</a>, for a test.`);
Also You can use jQuery html parser to do that like this:
var html = `This is a <a href="#">link</a>, for a test.`;
html = $.parseHTML( html);
$("#tagId").append(html);
I hope this would help you. Thanks