标签:
html
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>输入框样式特效</title>
<script src="../js/try.js"></script>
</head>
<body bgcolor="#ffcc99">
<table width="400" align="center">
<caption align="center">
输入框样式特效
</caption>
<tr>
<td align="right">
用户名:
</td>
<td>
<input type="text" value="type here" name="username"
size="29" onmouseover="mouseOver(this)"
onmouseout="mouseOut(this)"
style="width:106;height:211;border:1px solid;"
onfocus="clearText(this)"> <!-- onfocus当鼠标点到输入框时里面内容清空 -->
</td>
</tr>
</table>
</body>
</html>
JS
function mouseOver(input){
input.style.borderColor="blue";
input.style.backgroundColor="#ffff66";
};
function mouseOut(input){
input.style.borderColor="#000";
input.style.backgroundColor="#ffffff";
};
function clearText(input){
input.value="";
};
input.style.borderColor及input.style.backgroundColor 输入框样式特效 鼠标移过输入框 输入框背景变色
标签:
原文地址:http://www.cnblogs.com/yesiam/p/5877965.html