如何更换textarea的背景色及背景图片
<!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>textarea换背景最“偷懒”的方法。</title>
<style type="text/css">
/*onfocus onblur*/
.textareaOn{
padding:5px;
width:350px;
height:150px;
background:#FFFFCC;
border:1px solid #F90;
}
.textareaOut{
padding:5px;
width:350px;
height:150px;
border:1px solid #CCC;
}
</style>
</head>
<body>
<textarea id="textarea01" class="textareaOut" name="d" cols="" rows="" ></textarea>
<script type="text/javascript">
var textarea01 = document.getElementById("textarea01");
textarea01.onfocus = function(){
this.className = "textareaOn";
}
textarea01.onblur = function(){
this.className = "textareaOut";
}
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>textarea换背景最“偷懒”的方法。</title>
<style type="text/css">
/*onfocus onblur*/
.textareaOn{
padding:5px;
width:350px;
height:150px;
background:#FFFFCC;
border:1px solid #F90;
}
.textareaOut{
padding:5px;
width:350px;
height:150px;
border:1px solid #CCC;
}
</style>
</head>
<body>
<textarea id="textarea01" class="textareaOut" name="d" cols="" rows="" ></textarea>
<script type="text/javascript">
var textarea01 = document.getElementById("textarea01");
textarea01.onfocus = function(){
this.className = "textareaOn";
}
textarea01.onblur = function(){
this.className = "textareaOut";
}
</script>
</body>
</html>
作者:noel@淘宝网女装新款秋装连衣裙裤子外套上衣_2012时尚女装新款 Ecmall二次开发-PHP技术
地址:http://www.laohucheng.com/post/244/
版权所有©转载时必须以链接形式注明作者和原始出处及本声明!
Tags: 更换textarea的背景 引用(0)
ASP中日期函数
js日期时间控件(可选择到分)
2009
11:20
645
0


