English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

Vollständiges HTML-Tag-Verzeichnis

HTML: <form> target-Eigenschaft

Dieser Artikel beschreibt, wie man das HTML form target-Attribut verwendet, um die Stelle zu bestimmen, an der die empfangene Antwort nach dem Absenden des Formulars angezeigt wird. Ein Online-Beispiel zeigt, wie man das HTML form target-Attribut, die Kompatibilität der Browser, die Syntaxdefinition und die detaillierten Informationen zu seinen Eigenschaften verwendet.

 HTML <form> Tag

Online-Beispiel

Senden Sie ein Formular, das in einem neuen Fenster oder einer neuen Registerkarte geöffnet wird, d.h. die empfangene Antwort wird in einem neuen Fenster oder einer neuen Registerkarte angezeigt:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML form target-Eigenschaft verwenden-Grund教程(oldtoolbag.com)</title>
</head>
<body>
<form action="action_page.php" method="get" target="_blank">
  Vorname: <input type="text" name="fname"><br>
  Nachname: <input type="text" name="lname"><br>
  <input type="submit" value="Submit">
</form>
</body>
</html>
Testen Sie, ob es funktioniert ‹/›

Browserkompatibilität

IEFirefoxOperaChromeSafari

All major browsers support the target attribute.

Definition and Usage

The target attribute specifies a name or keyword that indicates where the received response is displayed after submitting the form.

The target attribute defines the name or keyword of the browser context (such as a tab, window, or inline frame).

HTML 4.01 with HTML5differences

HTML5 The target attribute is supported.

In HTML 4.01 The target attribute is deprecated in HTML.

Note:HTML5Since frames and framesets are not supported, the _parent, _top, and framename values are now mainly used for iframes.

Syntax

<form target="_blank|_self|_parent|_top|framename">

Attribute Value

ValueDescription
_blankIn a new window/Open in a tab.
_selfOpen in the same frame (default).
_parentOpen in the parent frame.
_topOpen in the entire window.
framenameOpen in the specified iframe.
 HTML <form> Tag