ÍøÂçѧԺ w3popÉçÇø ÍøÂç×ÊÔ´ ITÐÂÎÅ

w3pop.com :: ÍøÂçѧԺ :: HTML DOM :: HTML DOM target ÊôÐÔ

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

HTML DOM target ÊôÐÔ


×÷Õß:w3pop.com ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-04-28 ä¯ÀÀ:2033 :: ::

Definition and Usage
¶¨ÒåÓëÓ÷¨

The target property sets or returns where to open the action-URL in a form.
targetÊôÐÔ¿ÉÉèÖûò·µ»Ø±íµ¥µÄÈçºÎ´ò¿ªactionµØÖ·µÄ·½·¨

Syntax Óï·¨

formObject.target=_blank|_parent|_self|_top 
  • _blank - the action URL will open in a new window
    Ä¿±êURLÔÚд°¿Ú´ò¿ª
  • _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:
ÑÝʾÈçºÎÉèÖÃaction - URLµÄ´ò¿ª·½Ê½£º

<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>


ÑÝÁ·

Set the target property for a form
ÉèÖÃ±íµ¥µÄtarget±íµ¥

ÆÀÂÛ (0) All