首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

动态更动input标签的type属性(如password改为text)

2012-11-13 
动态更改input标签的type属性(如password改为text)HTML head meta http-equivContent-Type conten

动态更改input标签的type属性(如password改为text)

<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function removeSubmitFocus(){
document.all('pass').outerHTML="<input type=text name='"+document.all('pass').name+"' value='"+document.all('pass').value+"'>"
}
</script>
</head>
<body style="border:0;margin:5px;" scroll="auto">
<input type="button" name="hidden1" value="将password改为text " onclick="removeSubmitFocus()" ><span style="color:red">先在密码框中输入文字效果更明显</span>
<input type=password name="pass" id="pass"/>
</body>
</html>

(转自: http://hi.baidu.com/xuhui_ss/blog/item/24b41ddb197e09e739012f93.html)

热点排行
Bad Request.