美文网首页
一些常用的JavaScript语句

一些常用的JavaScript语句

作者: 骚伦 | 来源:发表于2017-02-17 23:49 被阅读0次

    alert()

    alert() 函数用来弹出警告框。

    语法:

    alert(string)

    其中,string 是要显示的内容

    警告框

    alert() 函数演示:

    演示



    document.write()

    document.write() 是 JavaScript 的输出语句,与C语言的 printf() 函数功能相同。

    语法:

    document.write(string)

    其中,string为要输出的内容。例如:

    输出

    console.log();

    方便调试,将信息输出到浏览器console

    语法:

    console.log(string);

    其中,string为要输出的内容。例如;

    console.log()

    相关文章

      网友评论

          本文标题:一些常用的JavaScript语句

          本文链接:https://www.haomeiwen.com/subject/ichrwttx.html