What is the best alternative to target="_blank"
?
Here is the doctype and html declaration we use:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
It's just valid as per XHTML Transitional. You can keep using them. It's only invalid as per XHTML Strict.
Regardless, for the case that, you could workaround this with a little help of JavaScript. Replace all target="_blank"
by rel="ext"
(which is the defacto standard for external links) and run the following (jQuery) script on page load:
$(document).ready(function() {
$('a[rel=ext]').attr('target', '_blank');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With