<Html>
<Head>
<Script type = "text/javascript">
Var g_percentFlag;
Var g_percent = 0;
Var g_count = 0;
Function intervalPercent (path ){
G_count + = 1;
Document. getElementById ("msg3"). value = g_count;
If (g_percent <100 ){
G_percent + = 20;
Document. getElementById ("msg2"). value = g_percent + "% ";
} Else if (g_percent = 100 ){
Document. getElementById ("msg2"). value = g_percent + "% ";
ClearInterval (g_percentFlag );
G_percent = 0;
} Else {
Document. getElementById ("msg2"). value = "Error .";
}
}
Function getPercentage (path ){
G_percentFlag = setInterval ("intervalPercent (\" "+ path +" \ ")", 200 );
}
</Script>
</Head>
<Body> www.2cto.com
<! -- <Input type = "button" value = "click" onclick = "a ="/> -->
<Input id = "msg2" type = "text"/> <br/>
<Input id = "msg3" type = "text"/> <br/>
<Script>
GetPercentage ("Hello! ");
</Script>
<Input type = "text" value = "nothing"/>
<Input type = "button" value = "click"/>
</Body>
</Html>
From CodeMan's Blog