将输入类型TEXT动态更改为PASSWORD [英] Dynamically change input type TEXT to PASSWORD

查看:119
本文介绍了将输入类型TEXT动态更改为PASSWORD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿嘿呀,


我遇到了另一个问题,有可爱的网络浏览器...它是如何喜欢

来真正****我关闭..:X


Anywho,我正在尝试这样做:

Hey Ya''ll,

I encountered another issue, with lovely internet explorer... How it likes
to truly **** me off.. :X

Anywho, i''m trying to do this:

展开 | 选择 | Wrap | 行号

推荐答案

...顺便说一句,Internet Explorer的版本是:6.0.2900.2180.xpsp_sp2_rtm.040803-2158 ..


PS这个版本号不是很荒谬吗?
... btw, version of Internet Explorer is: 6.0.2900.2180.xpsp_sp2_rtm.040803-2158..

p.s. Isn''t that version number just ridiculously long?


是的,在IE中(通过7)你不能在输入元素添加到文档后改变输入元素的类型。

您必须使用新的输入元素替换,并在添加之前设置其类型(和其他属性)。

如果克隆原始文件,你可以保留文本值,id和其他属性,

但你可能需要重置一些事件处理程序。


Yeah, in IE (through 7) you can''t change the type of an input element after it has been added to the document.
You''ll have to replace it with a new input element, with its type (and other attributes) already set before being appended.

If you clone the original you can preserve the text value, id and other attributes,
but you MAY need to reset some event handlers.


展开 | 选择 | Wrap | 行号


非常酷的人..谢谢..我不知道cloneNode和

replaceChild函数..他们将派上用场其他一些东西

我就是rking on ..一旦我回到我的'编码巢穴',我会测试这段代码:p


再次感谢

Very cool man.. thanks.. I was unaware of the cloneNode and
replaceChild functions.. they will come in handy with some other things
i''m working on.. I''ll test this code once i get back to my ''coding lair'' :p

Thanks again

展开 | 选择 | Wrap | 行号


这篇关于将输入类型TEXT动态更改为PASSWORD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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