Laurent Posted May 2, 2006 Share Posted May 2, 2006 Hi,I'd like to do an XHTML 1.0 web site that uses the Strict DTD but i have a stupid question about the <a /> tag (link). How can I specify the name of the frame in which the link will be open if the attribute "target" is not in the Strict DTD ?ThanksLaurent Link to comment Share on other sites More sharing options...
boen_robot Posted May 2, 2006 Share Posted May 2, 2006 Well, you don't use frames in XHTML strict on the first place . Link to comment Share on other sites More sharing options...
aspnetguy Posted May 2, 2006 Share Posted May 2, 2006 secondly you have to use javascript to do that Link to comment Share on other sites More sharing options...
raimo Posted May 2, 2006 Share Posted May 2, 2006 thirdly, here is very simple but good script to do it var elms = document.getElementsByTagName('a'); for (var i = 0; i < elms.length; i++){ elms[i].target = elms[i].getAttribute('rel'); } Save code to external javascript file (name as target.js or something) and include that JS-file just before </body> tag. (after last a-element of Your document).Include tag:<script src="target.js" type="text/javascript"></script>modify Your links like:<a rel="_blank" href="http://www.google.ru">Google</a>and Your links will open in new window. (rel = target) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now