JSFiddle - React, Tailwind, and code Playground

by hansenmc

HTML

<div id="result"></div>

JavaScript

var htmlString = '<html><body><div><a href="http://stackoverflow.com">this is a link</a></div></body></html>';
var link = $(htmlString).find('a').attr("href");

$('#result')
.append('Parsed this HTML string: <pre></pre><div>And found this URL: <a href="' + 
        link + '">' + link + '</a></div>')
.find('pre').text(htmlString).css('border','3px dashed #0F0');