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