js错误,参数不能正确显示
请教下面程序的有什么问题?input单标记<scripttype="text/javascript">window.onload=apple;functionapple(...
请教下面程序的有什么问题?input单标记
<script type="text/javascript">
window.onload=apple;
function apple()
{
var pup_time_h = document.getElementById('pup_time_h');
var pup_time_m = document.getElementById('pup_time_m');
var up_h = document.getElementById('up_h');
var up_m = document.getElementById('up_m');
var num_1,num_2,temp,hour_num,minu_num;
var result,submit;
temp=0;
num_1 = pup_time_h*60 + pup_time_m;
num_2 = up_h*60 + up_m;
temp=num_1-num_2;
hour_num=0;
minu_num=0;
for (var i=0; i<30; i++) {
if (temp >= 60 ) {
temp=temp-60;
hour_num=hour_num+1;
}
if (temp<60 && temp>0)
minu_num=temp;
}
submit.onclick=function()
{
document.getElementById("hour_num").value=hour_num;
document.getElementById("minu_num").value=minu_num;
}
}
</script> 展开
<script type="text/javascript">
window.onload=apple;
function apple()
{
var pup_time_h = document.getElementById('pup_time_h');
var pup_time_m = document.getElementById('pup_time_m');
var up_h = document.getElementById('up_h');
var up_m = document.getElementById('up_m');
var num_1,num_2,temp,hour_num,minu_num;
var result,submit;
temp=0;
num_1 = pup_time_h*60 + pup_time_m;
num_2 = up_h*60 + up_m;
temp=num_1-num_2;
hour_num=0;
minu_num=0;
for (var i=0; i<30; i++) {
if (temp >= 60 ) {
temp=temp-60;
hour_num=hour_num+1;
}
if (temp<60 && temp>0)
minu_num=temp;
}
submit.onclick=function()
{
document.getElementById("hour_num").value=hour_num;
document.getElementById("minu_num").value=minu_num;
}
}
</script> 展开
微测检测5.10
2023-07-11 广告
2023-07-11 广告
IEC62133与en62133的区别如下:1. 认证机构不同:IEC62133是国际的标准,它以国际通用的标准进行生产;而en62133采用的是欧盟的标准,它使用欧盟的生产需求进行生产。2. 宗旨不同:IEC62133的宗旨是促进电气、电...
点击进入详情页
本回答由微测检测5.10提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询