2016-02-29 137 views
-2

请纠正我,如果我错了谁能告诉我这个代码是什么错误

<html> 
<body> 

<script> 

function newyear() { 
alert("all the best"); 
} 
> 

</script> 
<form> 
<input type="button" onclick="newyear()" value="newyear" /> 

</form> 
</body> 

</html> 
+0

没有,它的工作原理https://jsfiddle.net/gurvinder372/5q906031/ – gurvinder372

+0

额外>之前标签 – cracker

+2

问题的重复 “请改正......” 是只是烦人。这是一个成年人的论坛。 – christutty

回答

1

<html> 
 
<body> 
 

 
<script> 
 

 
function newyear() { 
 
alert("all the best"); 
 
} 
 
// remove the extra character here 
 
</script> 
 
<form> 
 
<input type="button" onclick="newyear()" value="newyear" /> 
 

 
</form> 
 
</body> 
 

 
</html>

0

你有多余的字符(>)。删除它,你的代码很好。 像这样:

<html> 
<body> 
<script> 
    function newyear() { 
    alert("all the best"); 
    } 
</script> 
<form> 
    <input type="button" onclick="newyear()" value="newyear" /> 

</form> 
</body> 

相关问题