JavaScript 修改表单中Type的属性
来源:互联网 发布:jdk 7u9 windows i586 编辑:程序博客网 时间:2024/06/08 14:51
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Type 属性 </title>
<style type="text/css"></style>
</head>
<body>
<input name="" type="text" value="密码" class="inputText_1" id="tx" style="width:100px;" />
<input name="" type="password" style="display:none; width:100px;" id="pwd" />
<script type="text/javascript">
var tx = document.getElementById("tx"), pwd = document.getElementById("pwd");
tx.onfocus = function(){
if(this.value != "密码") return;
this.style.display = "none";
pwd.style.display = "";
pwd.value = "";
pwd.focus();
}
pwd.onblur = function(){
if(this.value != "") return;
this.style.display = "none";
tx.style.display = "";
tx.value = "密码";
}
</script>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Type 属性 </title>
<style type="text/css"></style>
</head>
<body>
<input name="" type="text" value="密码" class="inputText_1" id="tx" style="width:100px;" />
<input name="" type="password" style="display:none; width:100px;" id="pwd" />
<script type="text/javascript">
var tx = document.getElementById("tx"), pwd = document.getElementById("pwd");
tx.onfocus = function(){
if(this.value != "密码") return;
this.style.display = "none";
pwd.style.display = "";
pwd.value = "";
pwd.focus();
}
pwd.onblur = function(){
if(this.value != "") return;
this.style.display = "none";
tx.style.display = "";
tx.value = "密码";
}
</script>
</body>
</html>
- JavaScript 修改表单中Type的属性
- 用JavaScript改变表单中Type的属性(IE和火狐都兼容)
- html表单的type属性
- JS 动态修改 input 的 type 属性
- 修改input输入框的type属性
- JS 动态修改 input 的 type 属性
- HTML 18.3 表单元素input的输入属性type
- javascript改变表单属性
- 将javascript对象的所有属性放到匹配name值的表单元素中
- struts2中result的type属性详解
- input中type的属性和作用
- Struts2中result的type属性;值栈
- Html5中input标记的type属性
- struts2中result的type属性详解
- Dynamics CRM Form表单中通过javascript抓取触发change事件字段的属性名
- 修改input的type属性的几种方法
- 用JavaScript 记录用户在表单中所作的修改
- js修改input的type属性问题探讨
- 再发一篇测试呢?
- 关于XML的一些资料
- HDU 1079 Calendar Game
- JavaWeb项目中的字符拦截器
- 利用PL/SQL读写文件
- JavaScript 修改表单中Type的属性
- PLSQL中如何在COMMAND WINDOW下輸出語句
- Tips to Handle Linux APPs Crack Shit
- jquery学习笔记——简介
- 几种常见的基于Lucene的开源搜索解决方案对比
- 提问的智慧Oracle版
- 延时毫秒级别再继续运行的方法探讨
- C#中一个字符串变量分多行书写
- windows 桌面图标去除蓝底