html文本框元素 [英] html text box element

查看:86
本文介绍了html文本框元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用javascript向HTML输入控件添加属性?我想添加一个包含文本框原始内容的属性,以验证它是否已被用户更改.现在,我正在使用隐藏控件,但我想使检查更改更容易.

Is it possible to use javascript to add a property to an HTML input control? I would like to add a property that would contain the original content of the text box to verify if it has been changed by the user. Now I am using a hidden control, but I would like to make it easier to check for a change.

推荐答案

已经有一个属性,其中包含从HTML-defaultValue分配给文本输入和文本区域.

参见 http://www.w3.org/TR/DOM-Level -2-HTML/html.html#ID-26091157 [ ^ ]
There is already an attribute that contains the value that was assigned to text inputs and textareas from the HTML - defaultValue.

See http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26091157[^]


这篇关于html文本框元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆