首页 > 编程语言 > 详细

JavaScript常见的输出信息的方法

时间:2021-05-05 17:11:44      阅读:14      评论:0      收藏:0      [点我收藏+]

alert()

document.write()

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
        document.write(‘<p>今天天气真好!</p>‘);
    </script>
</body>
</html>
技术分享图片

 

 

console.log():这个是比较常用的

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
        console.log(‘今天天气特别好!‘);
    </script>
</body>
</html>
技术分享图片

 

 

JavaScript常见的输出信息的方法

原文:https://www.cnblogs.com/Friday1/p/14731611.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!