1、写到HTML某个元素中

使用document.getElementById("id")方法获得要操作的HTML页面元素,再使用innerHTML来获取或插入元素内容。

 javascript中的输出

javascript中的输出

2、写到HTML文档

javascript中的输出

javascript中的输出

3、写到控制台

console.log() 或者console.info() 或者console.error()

javascript中的输出

javascript中的输出

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2021-06-18
  • 2022-12-23
猜你喜欢
  • 2021-10-26
  • 2021-09-19
  • 2021-08-19
  • 2021-07-20
  • 2022-01-21
相关资源
相似解决方案