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

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <input> formtarget Attribut

Das Attribut 'formtarget' spezifiziert einen Namen oder ein Schlüsselwort, das angibt, wo die empfangene Antwort nach dem Absenden des Formulars angezeigt wird. Es überschreibt das Attribut 'target' des <form>-Elements.

 HTML <input> Tag

Online-Beispiel

Ein Formular mit zwei Submit-Buttons und verschiedenen Ziel-Fenstern:

<!DOCTYPE html>
<html>
<head>
<title>HTML:<input> formtarget Attribut - 基础教程网(oldtoolbag.com)</title>
<body>
<form action="action_page.php">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit as normal">
  <input type="submit" formtarget="_blank" value="Submit to a new window/tab">
</form>
</body>
</html>
Testen Sie es heraus ‹/›

Browserkompatibilität

IEFirefoxOperaChromeSafari

Internet Explorer 10, Firefox, Opera, Chrome und Safari unterstützen das Attribut 'formtarget'.

Note:Internet Explorer 9 Frühere Versionen unterstützen das Attribut 'formtarget' des <input>-Tags nicht.

Definition und Verwendung

Das Attribut 'formtarget' spezifiziert einen Namen oder einen Schlüsselwort, der angibt, wo die empfangene Antwort nach dem Absenden des Formulars angezeigt wird.

The formtarget attribute overrides the <form> element's target attribute.

Note:The formtarget attribute can be used with type="submit" and type="image".

HTML 4.01 and HTML5difference between

The formtarget attribute is an HTML5 new attributes added to

Note:HTML5Frames and framesets are not supported. The _parent, _top, and framename values are now mainly used for iframes.

Syntax

<input formtarget="_blank|_self|_parent|_top|framename">

Attribute value

ValueDescription
_blankIn a new window/Display the response in the tab.
_selfDisplay the response in the same frame (default).
_parentDisplay the response in the parent frame.
_topDisplay the response in the entire window.
framenameDisplay the response in the specified iframe.
 HTML <input> Tag