in Vanilla JS you can create a DOM element and set its innerHTML to the string you have, it will automatically reproduce the DOM structure inside :
// Don't forget to escape newlines
var rand = '<div class="readmorelink">\
<a href="//example.com/link-to-follow/">Continue Reading</a>\
</div>';
var elt = document.createElement('body');
elt.innerHTML = rand;
var links = elt.getElementsByTagName('a');
var target = links[links.length - 1];
// Target now equals the last 'a' element in the DOM tree
var clickEvent = new MouseEvent("click", {
"view": window,
"bubbles": true,
"cancelable": false
});
target.dispatchEvent(clickEvent);