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


1 comment:

  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