English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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.
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 ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the target attribute.
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).
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.
<form target="_blank|_self|_parent|_top|framename">
Value | Description |
---|---|
_blank | In a new window/Open in a tab. |
_self | Open in the same frame (default). |
_parent | Open in the parent frame. |
_top | Open in the entire window. |
framename | Open in the specified iframe. |