现在的位置: 首页 > 综合 > 正文

input 提示功能 CSS

2012年11月11日 ⁄ 综合 ⁄ 共 731字 ⁄ 字号 评论关闭

1.
<script>
function OnEnter( field ) { if( field.value == field.defaultValue ) { field.value = ""; } }
function OnExit( field ) { if( field.value == "" ) { field.value = field.defaultValue; } }
</script>
<input type=text value="预设文字" onFocus=OnEnter(this) onBlur=OnExit(this)>
2.

<style type="text/css">
<!--
input {border:1px solid #c00;}
input {star : expression(
onmouseover=function(){this.style.borderColor="#060"},
onmouseout=function(){this.style.borderColor="#c00"})}
-->
</style>

3.
<style type="text/css">
<!--
input {border:1px solid #c00; background:#fff; }
input {star : expression(
onmouseover=function(){this.style.backgroundColor="#eee"},
onmouseout=function(){this.style.backgroundColor="#fff"})}
.in40 {width:40px;}
.in80 {width:80px;}
.in120 {width:120px;}
.in200 {width:200px;}
-->
</style>

【上篇】
【下篇】

抱歉!评论已关闭.