# 5.4 鍵盤相關事件

## 通常用在表單欄位上

* focus：欄位取得焦點之後觸發。
* blur：欄位失去焦點之後，會觸發。
* change：新資料與原資料，不一樣時，會觸發。
* keydown：鍵盤按下去的狀態，會觸發。
* keyup：鍵盤按下去時放開的狀態，會觸發。
* input：資料有異動時，會觸發。

## 範例：鍵盤常用事件

HTML：

```markup
<input type="text" id="text_input">
```

範例：

{% embed url="<https://codepen.io/carlos411/pen/dyMNJdJ>" %}


---

# Agent Instructions: 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:

```
GET https://docs.webmix.cc/javascript-web/5.-shi-jian/5.5-jian-pan-shi-jian.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
