Ultimate Sidebar

Ways to Open New Windows in XHTML

104 16

    Regular HTML

    • In regular HTML, the way you open a link in a different window is to use the "target" attribute to your <a href></a> tag that you use to create a hyperlink. Target="_new" or target="_blank" will force the URL, when clicked upon, to open in a separate browser window.

    XHTML 1.0 Transitional

    • In XHTML 1.0 Transitional, you can also use the "target" attribute.

    XHTML 1.0 Strict

    • To open a new window in XHTML 1.0 Strict, the officially correct way is to use Javascript to set up an on-click handler with an "OpenWindow()" command. Another option is to give an attribute to links you want to open in a separate window and use Javascript to add the target attribute to the links. However, browsers will still open a new window if you use the "target" attribute, but this method will not officially validate using an XHTML 1.0 Strict validator.

Source: ...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.