HTML DOM target Property
Complete Form Object Reference
Definition and Usage
The target property sets or returns where to open the action-URL in a form.
Syntax
formObject.target=_blank|_parent|_self|_top
|
- _blank - the action URL will open in a new window
- _self - the action URL will open in the same frame as it was clicked
- _parent - the action URL will open in the parent frameset
- _top - the action URL will open in the full body of the window
Example
The following example sets the action-URL to open in a new window:
<html>
<head>
<script type="text/javascript">
function submitForm()
{
var x=document.getElementById("myForm");
x.target="_blank";
x.submit();
}
</script>
</head>
<body>
<form id="myForm" action="default.asp">
Name: <input type="text" value="Mickey Mouse" />
<input type="button" onclick="submitForm()"
value="Submit" />
</form>
</body>
</html>
|
Try-It-Yourself Demos
Set the
target property for a form
Complete Form Object Reference
The Altova MissionKit is a suite of intelligent XML tools, including:
XMLSpy® – industry-leading XML editor
- Support for all XML-based technologies
- Graphical editing views, powerful debuggers, code generation, & more
MapForce® – graphical data mapping tool
- Drag-and-drop data conversion with code generation
- Support for XML, DBs, EDI, Excel® 2007, text, Web services
StyleVision® – visual stylesheet designer
- Drag-and-drop stylesheet design for XML & databases
- Output to HTML, PDF, RTF, Word 2007, & more
And more…
Try before you buy with a free fully functional 30-day trial
Download today
|