当前位置: 代码迷 >> Web前端 >> 动态更动input标签的type属性(如password改为text)
  详细解决方案

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

热度:187   发布时间:2012-11-13 10:00:50.0
动态更改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;" class="bodyWindow" 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)

  相关解决方案