본문 바로가기

Computer

포커스된 입력폼 색상 변경


<html>
<head>
    <title>포커스 입력폼 색상 변경</title>
<style>
.box { font: 12px "verdana"; COLOR: #434343; border:#C8C8C8 1px solid;padding:4 0 0 4;}
.onInput3 { font: 12px "verdana"; COLOR: #434343; border:1px solid #F0563E; padding:4 0 0 4;}
.offInput3 { font: 12px "verdana"; COLOR: #434343; border:1px solid #C8C8C8; padding:4 0 0 4;}
</style>
<script language="javascript">
function overInput(f) {
    f.className = "onInput3";
}

function outInput(f) {
    f.className = "offInput3";
}
</script>
</head>

<body>

<input type="text" name="username" value="" style="height: 22px;width: 135px;" class="box" onFocus="overInput(this);" onBlur="outInput(this);">
<input type="password" name="passwd" style="height: 22px;width: 135px;" class="box" onFocus="overInput(this);" onBlur="outInput(this);">

</body>
</html>