这段代码出了什么问题?HTML验证,但JavaScript仍然无法正常工作.单击按钮时,时间键未定义.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
.numBtn { width: 100px;}
#microwave_oven{ position: relative;}
#microwave_screen img{ visibility: hidden;}
#microwave_screen{position: absolute; top: 100px; left: 100px;}
#keypad{position: absolute; top: 0px; left: 750px; width: 300px;}
#screen {position: absolute; top: 0px; left: 70px;}
#buttons {position: absolute; top: 50px; left: 0px;}
</style>
<title>Microwave Oven</title>
<script type="javascript">
<!--
//Variables
var timestring = '';
function timekey(numkey)
{
if (timestring.length >4)
{
}
else
{
timestring …Run Code Online (Sandbox Code Playgroud)