<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>confirm</title>
<script type="texr/java">
function rec(){
var mymessage=confirm("你会坚持的对么 ?");
if(mymessage==true)
{
document.write("一定竭尽全力!!!");}
else
{
document.write("想想自己是如何走到这一步的");
}
}
</script>
</head>
<body>
<input name="button" type="button" onclick="rec()"value="点击"/>
</body>
</html>
第6行 改为<script type="text/javascript">,第8,11,16行都含有中文的括号和分号
<script type="text/javascript">;
中英文()和;
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>confirm</title>
<script type="text/javascript">
function rec(){
var mymessage=confirm("你会坚持的对么 ?");
if(mymessage==true)
{
document.write("一定竭尽全力!!!");}
else
{
document.write("想想自己是如何走到这一步的" );
}
}
</script>
</head>
<body>
<input name="button" type="button" onClick="rec()" value="点击"/>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>confirm</title>
<script type="text/javascript">
function rec(){
var mymessage=confirm("你会坚持的对么 ?");
if(mymessage==true)
{
document.write("一定竭尽全力!!!");}
else
{
document.write("想想自己是如何走到这一步的");
}
}
</script>
</head>
<body>
<input name="button" type="button" onclick="rec()"value="点击"/>
</body>
</html>