> For the complete documentation index, see [llms.txt](https://vlog.ireneworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vlog.ireneworks.com/javascript/document-object-model/live-static.md).

# live, static

live -> document에 element를 추가/삭제 했을 때 바로 반영됨

static -> 바로 반영되지 않음

```javascript
const buttons = document.getElementById("buttons");
const sports = document.querySelectorAll("sports");


const onClickHandler = () => {
    const el = document.createElement("li"); //param은 태그이름으로 엘리먼트 생성, 다큐먼트에 표현되려면 노드에 먼저 반영되어야함
    el.textContext = "버튼";
    buttons.appendChild(el);
    sports.appendChild(el); //nodeList는 바로 반영되지 않음
}

buttons.onClick = onClickHandler; //buttons를 클릭하면 마지막 child에 생김

//노드 트리에 노드(엘리먼트)를 추가/삭제하면 HTMLCollection에 추가되고 바로 반영됨

const el = document.createElementNS(namespace, "div");

<div xmlns:a="https://www.w3.org/TR/html5/" /> //namespace 엘리먼트간의 충돌을 방지하기 위해 URI로 표현

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://vlog.ireneworks.com/javascript/document-object-model/live-static.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
