承接国内外服务器租用托管、定制开发、网站代运营、网站seo优化托管接单、网站代更新,新老站点皆可!!咨询QQ:3787320601
当前位置:首页  >  互联网圈  >  javascript输出语句有哪几种

javascript输出语句有哪几种

管理员 2023-03-24 08:16:04 互联网圈 116 ℃ 0 评论 1532字 收藏

javascript输出语句有哪几种

javascript中的输出语句有:1.alert语句,显示消息给用户;2.console.log语句,在浏览器控制台中打印输出信息;3.document.write语句,在网页中输出内容;


javascript输出语句有哪些


javascript中的输出语句有以下几种

1.alert语句

javascript中alert语句的作用是用于显示消息给用户,经常使用于创建一个消息正告框。

alert语句使用方法:

<script type="text/javascript">
   alert("hello world!");
</script>

2.console.log语句

javascript中console.log语句的作用是在浏览器控制台中打印输出信息。

console.log语句使用方法:

<script type="text/javascript">
   console.log("hello world!");
</script>

3.document.write语句

javascript中document.write语句的作用是在网页中输出内容,经常使用于向网页输出一段文字。

document.write语句使用方法:

<script type="text/javascript">
   document.write("hello world!");
</script>


文章来源:丸子建站

文章标题:javascript输出语句有哪几种

https://www.wanzijz.com/view/3256.html

TAG: javascript

相关文章

Related articles

X

截屏,微信识别二维码

微信号:weimawl

(点击微信号复制,添加好友)

打开微信