javascript鼠标点入input内value值隐藏事件
来源:互联网 发布:淘宝内部优惠券口令 编辑:程序博客网 时间:2024/04/30 21:07
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>鼠标事件</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js">
</script>
<!--
<script type="text/javascript">
//jQuery方法
$(document).ready(function(){
oElement = $("#myinput");
//聚焦时间、鼠标点击的时候触发聚焦时间
oElement.focus(function(){
if (this.value == "请输入关键字") {
this.value = "";
}
});
//聚焦时间、鼠标移开的时候触发聚焦时间
oElement.blur(function(){
if (this.value == "") {
this.value = "请输入关键字";
}
});
})
</script>
-->
<!--
<script type="text/javascript">
//javascript方法1、需要在标签内部添加焦点事件
function hidev(){
oe=document.getElementById("myinput");
if(oe.value=="请输入关键字") oe.value="";
}
function disv(){
oe=document.getElementById("myinput");
if(oe.value=="") oe.value="请输入关键字";
}
</script>
-->
<script type="text/javascript">
//javascript方法2
function dValue(){
oe = document.getElementById("myinput");
oe.onfocus = function(){
if (this.value == "站内搜索")
this.value = "";
};
oe.onblur = function(){
if (this.value == "")
this.value = "站内搜索";
}
}
window.onload = dValue;
</script>
</head>
<body>
<input type="text" id="myinput" value="站内搜索" size="35"/>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>鼠标事件</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js">
</script>
<!--
<script type="text/javascript">
//jQuery方法
$(document).ready(function(){
oElement = $("#myinput");
//聚焦时间、鼠标点击的时候触发聚焦时间
oElement.focus(function(){
if (this.value == "请输入关键字") {
this.value = "";
}
});
//聚焦时间、鼠标移开的时候触发聚焦时间
oElement.blur(function(){
if (this.value == "") {
this.value = "请输入关键字";
}
});
})
</script>
-->
<!--
<script type="text/javascript">
//javascript方法1、需要在标签内部添加焦点事件
function hidev(){
oe=document.getElementById("myinput");
if(oe.value=="请输入关键字") oe.value="";
}
function disv(){
oe=document.getElementById("myinput");
if(oe.value=="") oe.value="请输入关键字";
}
</script>
-->
<script type="text/javascript">
//javascript方法2
function dValue(){
oe = document.getElementById("myinput");
oe.onfocus = function(){
if (this.value == "站内搜索")
this.value = "";
};
oe.onblur = function(){
if (this.value == "")
this.value = "站内搜索";
}
}
window.onload = dValue;
</script>
</head>
<body>
<input type="text" id="myinput" value="站内搜索" size="35"/>
</body>
</html>
- javascript鼠标点入input内value值隐藏事件
- iframe页面修改parent页面的隐藏input部件value值,不能触发change事件。
- <input type="text" 鼠标移动去清空默认value onclick=javascript:this.value=''
- JavaScript如何获得input元素value值
- JavaScript如何获得input元素value值
- JavaScript如何获得input元素value值
- 改变隐藏的input中value的值
- javaScript隐藏input表单
- input text默认值鼠标事件
- Javascript:鼠标事件(转贴)
- javascript鼠标事件汇总
- javascript: 鼠标滚轮事件
- Javascript鼠标事件大全
- javascript鼠标事件总结
- 鼠标有关JavaScript事件
- javascript 鼠标事件总结
- Javascript鼠标事件汇总
- 鼠标有关JavaScript事件
- excel 让单元格上的文字全部显示(英文版)
- http://www.uml.org.cn 学习
- jquery-ajax简单示例
- C#实现并口输出输入高低电位
- 线程 Thread Runnable Join
- javascript鼠标点入input内value值隐藏事件
- Android实现异步加载图片 ListView
- 现代数字影视 电影使用标准
- 坐标变换
- java,hibernate和sql server对应的数据类型
- win 2008R2 下SqlServer 2005 修改密码报错解决方法
- JavaScript File API 文件上传
- java字节流对汉字输出为乱码的问题
- Tips-C#