User name grayed out
1 <!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en">2 <HTML>3 <Head>4 <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8">5 <styletype= "Text/css">6 . MyClass{7 Color:#c0c0c08 }9 </style>Ten <Scripttype= "Text/javascript"src=".. /js/jquery-1.6.js "></Script></Head> One <Body> A <TableBorder= "1"Align= "Center"> - <TR> - <th>User name</th> the <TD> - <inputtype= "text"value= "Enter user name"/> - </TD> - </TR> + </Table> - <Scripttype= "Text/javascript"> + $(function(){ A $("input"). addclass ("MyClass"); at $("input"). Focus (function(){ - $( This). Removeclass ("MyClass"); - $( This). Val (""); - }) - }); - </Script> in </Body> - </HTML>
Tanks move up and down.
1 <!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en">2 <HTML>3 <Head>4 <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8">5 <Scripttype= "Text/javascript"src=".. /js/jquery-1.8.2.js "></Script>6 </Head>7 <Body>8 <imgsrc=".. /images/zgl.jpg "/>9 <Scripttype= "Text/javascript">Ten //Initialize One $(function(){ A //position Picture - var$img= $("img"); - //Position the picture at the specified location the $img. Offset ({top: $, left: -}); - $img. Width ( -); - $img. Height ( $); - //add an event to a picture + $ (document). KeyDown (function(){ - //get the code code for the button + varCode=Event.keycode; A //Judging at if(Code== -){//on - $img. Offset ({top:y-= the}); - }Else if(Code== +){//under - $img. Offset ({top:y+= the}); - }Else if(Code== Panax Notoginseng ){//left - $img. Offset ({left:x-= the}); in }Else if(Code== the){//Right - $img. Offset ({left:x+= the}); to } + }); - }); the //Global Variables * vary= $; $ varx= -;Panax Notoginseng </Script> - </Body> the </HTML>