--- id: html-buttons title: "HTML Buttons" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["button element", "HTML button", "button type", "submit button", "reset button"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.88 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["html", "web", "frontend", "w3schools", "buttons", "forms"] raw_sources: ["https://www.w3schools.com/html/html_buttons.asp"] applied_in: [] github_commit: "" --- # [[HTML Buttons]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The HTML ` ``` **Button types** The `type` attribute defines what a button does when clicked. There are three button types: [S1] - `type="button"` β€” a normal clickable button (does nothing by default) - `type="submit"` β€” submits a form - `type="reset"` β€” resets all form fields ```html ``` Example within a form: [S1] ```html First name: ``` **Note:** You should always specify the type attribute. Inside a form, the default type is submit, and browsers may behave differently if the type is omitted. [S1] **Styling buttons** Buttons are often styled with CSS: [S1] ```html ``` **Disabled buttons** Use the `disabled` attribute to make a button unclickable: [S1] ```html ``` **Tip:** Disabled buttons cannot be clicked and usually appear faded. [S1] **Button with JavaScript** ```html ``` ## πŸ› οΈ 적용 사둀 (Applied in summary) The applied cases are a plain clickable button, the three typed buttons, a submit/reset pair inside a form, a CSS-styled button, a disabled button, and a button that runs JavaScript via `onclick`. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Typed buttons (HTML): ```html ``` Button running JavaScript (HTML): ```html ``` Disabled button (HTML): ```html ``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) The page presents three button types; choosing the right `type` is essential because the in-form default is `submit`: [S1] | `type` value | Behavior when clicked | Use when | |---|---|---| | `button` | A normal clickable button; does nothing by default | You want a button with custom (e.g. JavaScript) behavior only | | `submit` | Submits the form (the in-form default) | The button should send the form | | `reset` | Resets all form fields | The button should clear the form | Always specify the `type` to avoid inconsistent browser behavior when it is omitted. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. Important caveat: omitting `type` inside a form defaults to `submit` and can cause divergent browser behavior, so it should always be set explicitly. [S1] ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.88 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[HTML Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[HTML Forms]], [[HTML Form Elements]], [[HTML Input Types]], [[HTML Accessibility]] - **μ°Έμ‘° λ§₯락:** Referenced whenever adding clickable controls or form submit/reset actions to a page. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” HTML Buttons β€” https://www.w3schools.com/html/html_buttons.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "HTML Buttons" page (Astra wiki-curation, P-Reinforce v3.1 format).