JavaScript alert 换行 【每日一段代码47】
<html>
<head>
<script type="text/javascript">
function disp_alert()
{
alert("第一行文字"+'\n'+"第二行文字");
}
</script>
<body>
<input type="button" onclick="disp_alert()" value="点我">
</body>
</html>
html5
<html>
<head>
<script type="text/javascript">
function disp_alert()
{
alert("第一行文字"+'\n'+"第二行文字");
}
</script>
<body>
<input type="button" onclick="disp_alert()" value="点我">
</body>
</html>