Anyway, I loved getting all the opinions on opening links within posts to a new window or tab. I’m gonna be honest here, the comments really made me feel like an old fart set in her ways.
So I decided to at least try and set inline post links to "_blank"–that’s the attribute that opens them in a new window/tab based on the browser.
There was only one problem. I have years of content. Thousands of posts. How do I change the setting globally?
So instead of hand editing thousands of links on my blogs I simply wrote the following line of code…
$('.entry a').attr('target', '_blank');
That one line sets the attribute target to _blank in all a tags (links) found within the class entry.
Seriously.. how stinkin’ cool is that?!?
The best part… If I change my mind all I need to do is delete the code and all goes back to "normal". In my opinion, that’s the best part as I’m not completely sold on this just yet.
I told you. I’m set in my ways.