<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
body {
font:normal 12px/17px Arial;
}
div {
padding:2px;
}
input, textarea {
width:12em;
border:1px solid #888;
}
input:focus,
textarea:focus {
border:1px solid #f00;
background:#fcc;
}
</style>
</head>
<body>
<form action="" method="post" id="regForm">
<fieldset>
<legend>个人基本信息</legend>
<div>
<lable for="username">名称:</lable>
<input id="username" type="text" />
</div>
<div>
<lable for="pass">密码:</lable>
<input id="pass" type="text" />
</div>
<lable for="msg">详细信息:</lable>
<textarea id="msg" row="2" cols="20"></textarea>
</fieldset>
</form>
<script type="text/javascript">
$(document).ready(function(){
$(‘:input‘)
.focus(function(){
$(this).addclass(‘focus‘);
})
.blur(function(){
$(this).removeClass(‘focus‘);
});
});
</script>
</body>
</html>