用javascript在页面里面写入内容

2025-04-02 22:32:20

1、新建html文件

用javascript在页面里面写入内容

2、document.write写入内容

用javascript在页面里面写入内容

3、预览效果如图

用javascript在页面里面写入内容

4、document.write写入多条内容

用javascript在页面里面写入内容

5、预览效果如图

用javascript在页面里面写入内容

6、换行写的话必须加入反斜杠\

用javascript在页面里面写入内容

7、向控制台中书写内容

用javascript在页面里面写入内容

8、预览效果如图

用javascript在页面里面写入内容

9、书写特殊符号也要加入\

用javascript在页面里面写入内容

10、预览效果如图,附上代码<script type="text/javascript"> document.write('锾攒揉敫aaa'); document.write('<br/>'); document.write('bbb'); document.write('ccc'); document.write('ddd'); document.write('<br/>'); document.write('hello \ world'); document.write('<br/>'); document.write('hello \'world'); console.log('向控制台中书写内容'); </script>

用javascript在页面里面写入内容
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢