나의 발자취

[JS] event 속성 / document.write() 은 print()와 같음 본문

앱 개발/etc

[JS] event 속성 / document.write() 은 print()와 같음

달모드 2020. 11. 12. 15:43
<!doctype html>
<html>
<head>
  <title></title>
  <meta charset="utf-8">
</head>
<body>
    <input type = "button" value = "hi" onclick="alert('hi')">
    <input type = "text" onchange="alert('changed')">
    <input type = "text" onkeydown = "alert('key down!')">
    <h1>JavaScript</h1>
    <script>
        document.write('hello world');
        document.write(1+1);
    </script>

    
  <h1>Html</h1>
  1+1
 
  </body>
  </html>
Comments