Javascript: find URLs in a document
- by user317005
how do I find URLs (i.e. www.domain.com) within a document, and put those within anchors: < a href="www.domain.com" www.domain.com< /a
html:
Hey dude, check out this link www.google.com and www.yahoo.com!
javascript:
(function(){var text = document.body.innerHTML;/*do replace regex => text*/})();
output:
Hey dude, check out this link <a href="www.google.com">www.google.com</a> and <a href="www.yahoo.com">www.yahoo.com</a>!