/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//Open External Links in New Window $('a[href^="http://"]') .attr({ target: "_blank" }); //Makes all links open in a new window $('a[href^="http://"].target') .attr({ target: "_blank" }); //a link with the class of "target" opens in a new window
URL: http://www.sohtanaka.com/web-design/jquery-easy-tips-tricks-tutorial/