I'm trying to create a jQuery script which will create auto internal links in a single web page. I have almost done it. I am stuck with the link itself is converting.
If I am finding the string in a web page, is there a way to find in tag of the text?
$(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>'));
}
});
});
});
Help me it will be helpful for all blogger blogs.