I want to take a bunch of anchor tags and make sure that they all open in a new tab.
I know I should do something like this $('a').attr('target', '_blank'); but the catch is that the HTML I am trying to modify is in a string variable.
See example:
I have a bunch of raw HTML in a string like this:
var rawHTML = 'Hello there, <a href="http://www.google.com">this</a> is a link.'
How can I convert that to be something like this:
processedHTML = 'Hello there, <a href="http://www.google.com" target="_blank">this</a> is a link.'