HTML元素 - input type=hidden

定义

传输关于客户/服务器交互的状态信息。

Transmits state information about client/server interaction.

注释

这种输入类型用户无法控制,但是却在提交表单时发送 value 属性的值。

此元素在 Internet Explorer 3.0 及以上版本的 HTML 和脚本中可用。

此元素不显示。

此元素不需要关闭标签。

This input type presents no control to the user, but sends the value of the value property with the submitted form.

The INPUT type=hidden element is available in HTML and script as of Internet Explorer 3.0.

This element is not rendered.

This element does not require a closing tag.

注:INPUT type=hidden 元素不会显示在文档里,所以用户也无法操作该元素。该元素通常用来传输一些客户端到服务器的状态信息。虽然此元素不会显示出来,但是用户可以通过查看 HTML 的源代码看到该元素属性的值,所以请注意,不要用该元素传递敏感信息,比如密码什么的。

Note: The INPUT type=hidden element does not appear visibly in the document and that the user does not interact with. It can be used to transmit state information about the client or server.

Remember that hidden fields can be viewed if your readers look at the source HTML, so don't use it for sensitive information such as passwords.

示例代码

<INPUT TYPE=hidden NAME=recipient VALUE="haha@blabla.cn">

<INPUT TYPE=hidden NAME=subject VALUE="Feedback on your HTML Reference">


posted @   胡.杰  阅读(492)  评论(1编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
点击右上角即可分享
微信分享提示