<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>js输出</title>
</head>
<body><script type="text/javascript">alert('hello javascript'); // window.可省略 </script>
</body>
</html>
document.write('hello javascript');
<body><p id="one"></p><script type="text/javascript">document.getElementById('one').innerHTML = "this is p." //先找到要写入的元素,再写</script>
</body>
console.log(123);