function宣言の外にメソッドを記述すると、自動的に動いてしまうのがミソ
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body>
<p><input type="text" size="82" name="ppp"></p>
</body>
</html>
<script language="JavaScript">
var count=0;
var midasi = "ただ今印刷中でしゅ ";
var progre = "■";
var disp="";
alert("aaa");
ppp.value = count;
disp = midasi ;
intervalId = setInterval("putmsg()",500);
function putmsg(){
if (count < 10 ){
disp = disp + progre ;
count ++;
}else{
disp = midasi ;
count =0;
}
ppp.value = disp ;
}
</script>