Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Target Attribute - HTML/JavaScript

RSS
Modified on Sun, Feb 22, 2015, 8:20 AM by Administrator Categorized as HTML and CSS
HTML and JavaScript can specify where to open a linked document or window.

In HTML, this is done by way of the target attribute on the <a> element. In JavaScript, this same set of values can be used as the second parameter to the window.open() method.

Valid Values

ValueDescription
_blankOpens the linked document in a new window or tab
_newtabOpens the linked document in a new tab
_selfOpens the linked document in the same frame as it was clicked (this is default)
_parentOpens the linked document in the parent frame
_topOpens the linked document in the full body of the window
framenameOpens the linked document in a named frame

HTML Usage

<a target="_blank|_self|_parent|_top|framename">click here</a>

<html>...<body><base target="_blank|_self|_parent|_top|framename" >...</body></html>

JavaScript

window.open(url, "_blank|_self|_parent|_top|framename")

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2018, Patrick Jasinski.