you can use parseInt() to get the integer.
BTW, it is javascript, not java in html. Although they look alike, they are totally different.
the following is a code for reference
var in_days,in_hours,in_minutes,in_seconds,in_total_seconds;
do{//if it is not a number,ask user to enter again. you can remove this loop if you don't need to validate user input
in_days=parseInt(prompt("Please enter a number of days:" ));
}while(isNaN(in_days));
do{
in_hours=parseInt(prompt("Please enter a number of hours:" ));
}while(isNaN(in_hours));
do{
in_minutes=parseInt(prompt("Please enter a number minutes: "));
}while(isNaN(in_minutes));
do{
in_seconds=parseInt(prompt("Please enter a number seconds: "));
}while(isNaN(in_seconds));
do{
in_total_seconds=in_seconds+in_minutes*60+in_hours*60*60+in_days*24*60*60;
}while(isNaN(in_total_seconds));
alert(in_total_seconds);
with promot, u get a string
本帖于 2004-02-06 15:24:48 时间, 由普通用户 old-cotton 编辑