Open Links in New Pop off Window using Jquery


Here we want to open the links provided in the a tag in the new window.


HTML

<html>
    <head>
        <title></title>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js"></script>
    </head>
    <body>
        <a href="http://www.google.com.com/" >click me</a>
        <a href="http://www.facebook.com/" >click me</a>
    </body>
</html>


Jquery  

$(document).ready(function(){ $("a").click(function(){ event.preventDefault(); window.open($(this).attr("href"), "My Task", width=600,height=300); }); })

Run it here Jsfiddle


2 comments:

  1. hi guys i have one doubt that is i can give one word that is "one" after given this word i want to this kind of answer like "one" ,"neo" ,"eno" can u pls do it and forward me

    ReplyDelete
  2. Jquery is the basic language and very important for developers to understand it. Thanks for giving the presentations on tags students who are working on it will definitely find it helpful.

    ReplyDelete