<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src=\'../jquery.js\'></script>
<style>
.hide{display:none}
.test{background:green}
</style>
</head>
<body>
<div id=\'test\'>ttttt</div>
<input type=\'text\' id=\'adress\' value=\'请输入\' />
<script>
$(function(){
$(\'#adress\').focus(function(){
var text=$(this).val();
if(text==\'请输入\'){
$(this).val(\'\');
}
});
$(\'#adress\').blur(function(){
var text=$(this).val();
if(text==\'\'){
$(this).val(\'请输入\');
}
});
});
</script>
</body>
</html>
相关文章:
- jQuery获得文本框焦点和失去焦点 2021-12-19
- jquery得到焦点和失去焦点 2021-12-19
- input获得焦点和失去焦点 2017-12-12
- jquery获取和失去焦点改变样式 2021-12-29
- input文本框获取焦点和失去焦点判断 2021-12-09
- jquery注冊文本框获取焦点清空,失去焦点赋值 2021-11-30
- input框获取焦点和失去焦点,select框change事件 2021-12-20