How To Manage External Links Using JQuery

Posted by Lasantha Bandara on August 10th, 2010 File Under : jquery3 Comments

In this tutorial I am going to show how to style your external links differently from the other links using Jquery.Also after adding this trick to your blogger blog or web site,all external link of your site will open in new window.This is very easy to do and you can view a DEMO HERE.If you want to know further details about this trick you can read this :

Now to add this jquery external links effect to your site follow the steps given below.

1.Login to your blogger dashboard--> Design - -> Edit HTML.

2.Scroll down to where you see </head> tag .

3.Copy below code and paste it just before the </head> tag .

<script type="text/javascript" src=""></script>

<script type="text/javascript">

    jQuery - External Links
    Created by Andrea Cima Serniotti -


$(document).ready(function () {

        // ---- External Links ----------------------------------------------------------------------------------------------------

            $("a[href*='http://']:not([href*='"+location.hostname+"']),[href*='https://']:not([href*='"+location.hostname+"'])").attr("target","_blank").attr("title","Opens new window").addClass("external");


<style type="text/css">
.external{background:url( top right no-repeat;padding-right:18px}

4.Now save your template.

You are done.Now all of your external links open in new windows and can identify external links from other links.

File Under : jquery

3 Responses to “How To Manage External Links Using JQuery”

  1. Maher Zain says:

    Great solution!! Thanx 🙂

  2. Mido says:

    thanks nice tips

  3. Chathuranga says:

    Work on Thank friend.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.