I am making a entire website and have already implemented everything...
the problem is i dont want to go to EVERY single link and add "target=_blank_"
so is there a way to make it so that EVERY link that a user clicks on in my website...it opens in a NEW WINDOW
please help
Opening ALL links in new window
Moderator: General Moderators
target is depracated. W3C recommends Javascript for that. Add the following to the <a> elements.For accessibility you should also add an identical event handler "onkeypress" for people not using a pointing device.
Code: Select all
onclick="return !window.location(this.href)"- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Not to try to sell you on a different idea, but there is an interesting article on Sitepoint regarding opening new windows with hyperlinks.
If you must open new windows, use JavaScript instead of the depricated (and XHTML non-comliant) target="_blank" attribute.
If you must open new windows, use JavaScript instead of the depricated (and XHTML non-comliant) target="_blank" attribute.