As follows:
Copy codeThe Code is as follows:
<Html>
<Head>
<Title> jquery </title>
<Style>
Body
{
Font-size: 12px;
}
Li
{
List-style: none;
Height: 34px;
Padding-top: 5px;
}
</Style>
<Script type = "text/javascript" src = "jquery-1.2.6.pack.js"> </script>
<Script type = "text/javascript">
$ (Document). ready (function (){
Var oInputs = $ ("ul. demo input ");
OInputs. each (function (I ){
OInputs. eq (I). focus (function (){
OInputs.eq( I ).parent().css ("background-color", "ccf ");
}). Blur (function (){
OInputs.parent().css ("background-color ","");
})
});
OInputs. focus (function (){
Watermark (this).css ("background-color", "ff9"). blur (function (){
Certificate (this).css ("background-color ","");
});
})
})
</Script>
</Head>
<Body>
<Ul class = "demo">
<Li>
<H5>
Registration options </Li>
<Li> User name: <input type = "text" value = "" id = "name" style = "width: 200px"/> </li>
<Li> password: <input type = "password" value = "" id = "pass" style = "width: 200px"/> </li>
<Li> love: <input type = "checkbox" value = ""/> basketball <input type = "checkbox" value = ""/> football <input
Type = "checkbox" value = ""/> music </li>
</Ul>
</Script>
</Body>
</Html>