我有一个问题,为什么我的代码不能正确执行,在应用这些命令时我需要尽可能基本。我点击了转换按钮,什么也没有,我也需要一个命令吗?这是家庭作业,我已经涉猎了好几个小时。
编辑***
<html>
<head>
<script type="text/javascript">
<script>
function Convert()
onclick= document.getElementById('Convert')
var years = document.getElementById("year").value;
var days = document.getElementById("days").365.25 * years;
var hours = document.getElementById("hours").(365.25 * 24) * years;
var minutes = document.getElementById("minutes").(365.25 * 24 * 60) * years;
var seconds = document.getElementById("seconds").(365.25 * 24 * 60 * 60) * years;
document.getElementById('days').value = days;
document.getElementById('hours').value = hours;
document.getElementById('minutes').value = minutes;
document.getElementById('seconds').value = seconds;
});
</script>
</head>
<body>
Years: <input type='text' id='years' />
<button id='Convert'onclick= "Convert()" value= "Convert"/> Convert </button>
Days: <input type='text' id='days' />
Hours: <input type='text' id='hours' />
Minutes: <input type='text' id='minutes' />
Seconds: <input type='text' id='seconds' />
</body>
</html>