SOURCE

console 命令行工具 X clear

                    
>
console
<!DOCTYPE html>
<html>
<head>
<script>
var txt="";
function message()
{
try
  {
  adddlert("Welcome guest!");
  }
catch(err)
  {
  txt="本页有一个错误。\n\n"; //文本换行\n\n
  txt+="错误描述:" + err.message + "\n\n";
  txt+="点击确定继续。\n\n";
  alert(txt);
  }
}
</script>
</head>

<body>
<!--两种类型的按钮-->
<input type="button" value="查看消息" onclick="message()">
<button type="button" onclick="message()">Click here</button>
</body>

</html>