- Auto inernal links with jquery
- $(document).ready(function(){
- $("a[href]").each(function()
- {
- $link=this.href;
- $text=this.text;
- $('*:contains("'+$text+'")').each(function(){
- if($(this).children().length < 1){
- $(this).text($(this).text().replace($text, '<a href="'+$link+'" target="_blank">'+$text+'</a>'));
- }
- });
- });
- });
- $("a[href]").attr('target', '_blank');