manman89

JQUERY - ADD TARGET BLANK TO ALL LINKS

Nov 14th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.24 KB | None | 0 0
  1. <script type="text/javascript">
  2.     $(document).ready(function(){
  3.         $("html a").each(function (){
  4.             if($(this)[0].href.toLowerCase().indexOf("http://www.kingdino.com") == -1){
  5.                 $(this).attr("target","_blank");
  6.             }
  7.         });
  8.     });
  9. </script>
Advertisement
Add Comment
Please, Sign In to add comment