我已经在我的xhtml文档中关闭了所有可能的标记,其中还包含一些脚本部分,但我收到了关闭输入标记问题。这是我的代码:
<!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>
<title>Assignment3</title>
</head>
<body>
<input type="checkbox" name="check" value="tick" onclick="addCostApple()"/>apple<br/><br/>
<input type="checkbox" name="check" value="tick" onclick="addCostOrange()"/>banana<br/><br/>
<input type="checkbox" name="check" value="tick" onclick="addCostBanana()"/>cherry<br/><br/>
<input type="button" value="Submit" onclick="displayCost()">
<script type="text/javascript">
var total=0;
function addCostApple()
{
total = total + 59;
}
function addCostOrange()
{
total = total + 49;
}
function addCostBanana()
{
total = total + 39;
}
function displayCost()
{
var tax = (0.05*total)/100;
alert("Cost : $ "+(total/100)+"\nTax : $"+tax+"\nTotal : $"+(total+tax)/100);
}
</script>
</body>
</html>
这就是我得到的错误:
XML Parsing Error: mismatched tag. Expected: </input>. Location:
file:///home/aravind/aravind/Sessions/Web%20programming/JavaScript
/day2/Assignment3.xhtml Line Number 35, Column 3: