[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/API/HTML_DOM_API [Back]  [Original]

The HTML DOM API - Web API | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

The HTML DOM API

Baseline Widely available *

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.

* Some parts of this feature may have varying levels of support.

HTML DOM API HTML elements .

HTML DOM API .

In this article

HTML DOM

HTML HTML DOM . Drag and Drop, WebSockets, Web Storage API .

HTML

(DOM) document , Document . , (: ) .

, . DOM , Node .

. . Element . HTML SVG XML .

, .

Structure of a document with elements inside a document in a window [Structure of a document with elements inside a document in a window]

Document DOM , HTML DOM , HTML .

HTML Document .

HTML

Element HTML HTMLElement HTML . Element HTML . HTMLElement hidden innerText .

HTML HTML DOM , HTMLElement . HTMLElement Node ( ). Node HTML , , , .

HTMLElement , ID, , HTML, HTML .

HTMLElement , HTMLElement . <canvas> HTMLCanvasElement . HTMLCanvasElement , height getContext() HTMLElement .

HTML .

Hierarchy of interfaces for HTML elements [Hierarchy of interfaces for HTML elements]

. , DOM HTMLAnchorElement <a> . HTMLElement Element, Node, EventTarget .

. Node , . , EventTarget .

. <audio> <video> . HTMLAudioElement HTMLVideoElement HTMLMediaElement , HTMLElement . HTMLMediaElement .

HTML DOM API , . DOM , Introduction to the DOM .

HTML DOM

HTML DOM API . HTML DOM .

HTML DOM API

HTML DOM API HTML . HTML DOM API HTML .

HTML

HTML ( ) .

HTML

HTML

HTML , ( ) .

<form> <input> , .

API <img> <picture> .

<audio> <video> HTML .

HTML Drag and Drop API ( ) , .

History API , .

Web Components API .

HTML DOM API . PromiseRejectionEvent JavaScript Promise .

API

HTML API .

Web Storage API .

Web Workers API .

HTML WebSockets API .

EventSource server-sent events .

"" <input> input .

JavaScript

js
const nameField = document.getElementById("userName");
const sendButton = document.getElementById("sendButton");

sendButton.disabled = true;
// [:            ].
//nameField.focus();

nameField.addEventListener("input", (event) => {
  const elem = event.target;
  const valid = elem.value.length !== 0;

  if (valid && sendButton.disabled) {
    sendButton.disabled = false;
  } else if (!valid && !sendButton.disabled) {
    sendButton.disabled = true;
  }
});

Document getElementById() , ID userName and sendButton <input> DOM . .

"" disabled HTMLInputElement true "" . HTMLElement focus() .

addEventListener() input . 0 "" . .

'' .

HTML

(form) HTML .

html
<p>  . "*"     .</p>
<form action="" method="get">
  <p>
    <label for="userName" required>Your name:</label>
    <input type="text" id="userName" /> (*)
  </p>
  <p>
    <label for="email">Email:</label>
    <input type="email" id="userEmail" />
  </p>
  <input type="submit" value="Send" id="sendButton" />
</form>

Specification
HTML
# htmlelement


Web Proxy Viewer  |  New URL  |  Original Page