The `target` attribute in an HTML form specifies where to display the response received after form submission. It determines the browsing context (e.g., tab, window, or frame) where the result of the form action should load.
1. `_self` (Default)
Loads the response in the same window/tab where the form was submitted.
2. `_blank`
Opens the response in a new tab or window (depends on the user's browser settings).
3. `_parent`
Loads the response in the parent frame (relevant when using frames/iframes).
4. `_top`
Loads the response in the full body of the window, breaking out of any frames.
5. `framename`
Loads the response in a specific named `` or `
html
This form opens the response in a new tab/window when submitted.
Use the `formtarget` attribute on `` or `
html
Here, clicking "Preview" opens the response in a new tab, while "Save" uses the default behavior.
By understanding the `target` attribute, you can control how form submissions interact with the user’s browsing context.
版权声明: 知妳网保留所有权利,部分内容为网络收集,如有侵权,请联系QQ793061840删除,添加请注明来意。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态