jQuery is a new kind of JavaScript Library.
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.
-------------------------------------------------------------------------
1.文本框的聚焦(focus):
<script type="text/javascript" src="/script/jquery-1.3.2-vsdoc.js"></script>
<link href="css/s.css" rel="Stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function()
{
debugger;
$("input[@type=text][name=txt],input[@type=password][name=pwd],textarea[name=txta]").focus(function()
{
$(this).addClass("ie_focus");
}).blur(function()
{
$(this).removeClass("ie_focus");
});
})
</script>
------------------
s.css
body
{
font: .9em/1.5 "Lucida Grande", "Trebuchet MS", "Bitstream Vera Sans", Verdana, Helvetica, sans-serif;
}
form
{
width: 20em;
margin: 4em auto;
}
dt
{
clear: left;
float: left;
}
dd
{
clear: right;
margin-left: 6em;
}
input, textarea
{
width: 12em;
border: 1px solid #ccc;
}
input:focus, textarea:focus
{
border: 1px solid #f00;
background: #fcc;
}
.ie_hover { background: #ffc; }
.ie_focus
{
border:1px solid #f00;
background:#fcc;
}
-------------------------------------------------------------------------