νΌ (νΌνΈλ¦°)
<form action="" method="get" class="form-example">
<div class="form-example">
<label for="name">Enter your name: </label>
<input type="text" name="name" id="name" required />
</div>
<div class="form-example">
<label for="email">Enter your email: </label>
<input type="email" name="email" id="email" required />
</div>
<div class="form-example">
<input type="submit" value="Subscribe!" />
</div>
</form>
π action, method
action
- μμ λ°μ΄ν°λ₯Ό μ²λ¦¬ν νλ‘κ·Έλ¨μ URI μ§μ
- <button>, <input type="submit">, <input type="image"> μμμ formaction νΉμ±μΌλ‘ μ¬μ μ κ°λ₯
method
- μμμ μ μΆν λ μ¬μ©ν HTTP λ©μλ.
- post: POST λ©μλ. μμ λ°μ΄ν°λ₯Ό μμ² λ³Έλ¬ΈμΌλ‘ μ μ‘
- get: GET λ©μλ. μμ λ°μ΄ν°λ₯Ό action URLκ³Ό ? ꡬλΆμ λ€μ μ΄μ΄ λΆμ¬μ μ μ‘
- κ²μμ μ¬μ©
- dialog: μμμ΄ <dialog> μμ μμΉν κ²½μ°, μ μΆκ³Ό ν¨κ» λν μμλ₯Ό λ«μ
- <button>, <input type="submit">, <input type="image"> μμμ formmethod νΉμ±μΌλ‘ μ¬μ μ κ°λ₯
<!-- Form which will send a GET request to the current URL -->
<form>
<label
>Name:
<input name="submitted-name" autocomplete="name" />
</label>
<button>Save</button>
</form>
<!-- Form which will send a POST request to the current URL -->
<form method="post">
<label
>Name:
<input name="submitted-name" autocomplete="name" />
</label>
<button>Save</button>
</form>
<!-- Form with fieldset, legend, and label -->
<form method="post">
<fieldset>
<legend>Title</legend>
<label><input type="radio" name="radio" /> Select me</label>
</fieldset>
</form>
π fieldset, legend
<form>
<fieldset>
<legend>Choose your favorite monster</legend>
<input type="radio" id="kraken" name="monster" value="K" />
<label for="kraken">Kraken</label><br />
<input type="radio" id="sasquatch" name="monster" value="S" />
<label for="sasquatch">Sasquatch</label><br />
<input type="radio" id="mothman" name="monster" value="M" />
<label for="mothman">Mothman</label>
</fieldset>
</form>
<fieldset> μ€νμΌλ§
- <fieldset>μ display μμ±μ κ°μ κΈ°λ³Έμ μΌλ‘ blockμ΄λ©°,
- μΈλΌμΈν display κ°μ μ§μ νλ©΄ inline-block, κ·Έλ μ§ μμΌλ©΄ blockμ²λΌ νλ
- <fieldset>μ κΈ°λ³Έ μ€νμΌλ‘ μ½ν μΈ λ₯Ό κ°μΈλ 2px λλΉμ groove ν λ리, μμ μμ λ΄λΆ μ¬λ°±, κ·Έλ¦¬κ³ min-inline-size: min-contentλ₯Ό κ°μ§
- <legend> μμλ <fieldset>μ λΈλ‘ μμ λ°©ν₯(λκ° μμͺ½) ν λ리 μλ₯Ό κ°λ‘μ§λ₯΄λ μμΉμ λμ
- <legend> λν μμ μ λΈλ‘ μμ λ§₯λ½μ λ§λ€λ©°, λλΉλ μμ μ μ½ν μΈ μ λ§μΆ°μ Έ λμ΄λκ±°λ μ€μ΄λ¬
- displayλ νμ λΈλ‘νμ΄ λ¨. μ¦, display: inlineλ blockμ²λΌ λμ
- Microsoft Edgeμ Google Chromeμλ <fieldset> λ΄λΆμμ νλ μ€λ°μ€μ 그리λ λ μ΄μμμ μ¬μ©ν μ μλ λ²κ·Έκ° μ‘΄μ¬.
π input , type
Category | Type | Description |
---|---|---|
Text input types | text | Single-line text input. |
password | Password input (obscures the text). | |
Email input (validates email addresses). | ||
url | URL input (validates URLs). | |
number | Numeric input (accepts numbers only). | |
range | Numeric input with a specified range. | |
date | Date input (accepts dates in a specified format). | |
datetime-local | Date and time input (accepts date and time in a specified format). | |
month | Month input (accepts months). | |
week | Week input (accepts weeks). | |
time | Time input (accepts times). | |
Checkbox input types | checkbox | Checkbox input (single selection). |
radio | Radio button input (single selection from a group). | |
File input types | file | File input (allows users to upload files). |
Button input types | button | Button input (submits a form or triggers an action). |
reset | Reset button input (resets a form). | |
submit | Submit button input (submits a form). | |
Other input types | color | Color input (allows users to select a color). |
image | Image input (allows users to upload an image). | |
range | Range input (allows users to select a value from a range). | |
search | Search input (allows users to search for something). | |
tel | Telephone input (accepts phone numbers). | |
textarea | Multi-line text input. |
<label for="name">Name (4 to 8 characters):</label>
<input
type="text"
id="name"
name="name"
required
minlength="4"
maxlength="8"
size="10" />
- labelμ forκ³Ό inputμ idμ μ°κ²°λ¨.
- lableμ μμμΌλ‘ λ£μΌλ©΄ for μ ν΄λ λ¨.
π 체ν¬λ°μ€
<form>
<div>
<input
type="checkbox"
id="subscribeNews"
name="subscribe"
value="newsletter" />
<label for="subscribeNews">λ΄μ€λ ν°λ₯Ό ꡬλ
νμκ² μ΅λκΉ?</label>
</div>
<div>
<button type="submit">ꡬλ
νκΈ°</button>
</div>
</form>
- name νΉμ±μ subscribeλ‘, value νΉμ±μ newsletterμΌλ‘ μ§μ
- νΌμ΄ μ μΆλλ©΄ μ λ¬λ name/value μμ λ°μ΄ν°λ subscribe=newsletterμ κ°μ΄ νν
- λ§μ½ value νΉμ±μ΄ μλ΅λλ©΄, ν΄λΉ 체ν¬λ°μ€μ κΈ°λ³Έ κ°μ on
- νΌμ΄ μ μΆλ λ 체ν¬λ°μ€κ° 체ν¬λμ΄ μμ§ μμΌλ©΄ κ° μμ²΄κ° μλ²μ μ λ¬λμ§ μμ.
- λΌλμ€ λ²νΌμ νλμ μ§ν©μΌλ‘ κ·Έλ£Ήνλμ΄ κ·Έ μμμ λ¨ νλλ§ μ νλ μ μμ§λ§,
- 체ν¬λ°μ€μ κ²½μ°λ κ°κ°μ κ°μ μΌκ³ λ μ μμ. λ€μμ 컨νΈλ‘€μ΄ μ‘΄μ¬ν λ λΌλμ€ λ²νΌμ μ 체μμ νλμ μμμ λν μ νλ§μ νμ©νκ³ , 체ν¬λ°μ€λ μ¬λ¬ κ°μ μμκ° μ νλλ κ²μ νμ©
π μ€κ° μν 체ν¬λ°μ€
- Javascriptμ HTMLInputElement κ°μ²΄μ indeterminate νΉμ±μ μν΄ μ€μ
- HTML νΉμ±μ μ΄μ©ν΄μλ μ€μ ν μ μμ
js
inputInstance.indeterminate = true;
indeterminate μνμ μλ 체ν¬λ°μ€λ λλΆλΆμ λΈλΌμ°μ μμ μνμ μ κ°μ§.
- 체ν¬λ°μ€κ° μ¬λ¬ νμ 체ν¬λ°μ€λ₯Ό κ°μ§λ κ²½μ°
- λͺ¨λ νμ 체ν¬λ°μ€κ° νμ±νλλ©΄, μμ 체ν¬λ°μ€ λν νμ±ν
- νμ 체ν¬λ°μ€ μ€ νλκ° λ€λ₯Έ 체ν¬λ°μ€λ€κ³Όλ λ€λ₯Έ μνλ₯Ό κ°μ§λ€λ©΄ μμ 체ν¬λ°μ€λ indeterminate μν
const overall = document.querySelector("#enchantment");
const ingredients = document.querySelectorAll("ul input");
overall.addEventListener("click", (e) => {
e.preventDefault();
});
for (const ingredient of ingredients) {
ingredient.addEventListener("click", updateDisplay);
}
function updateDisplay() {
let checkedCount = 0;
for (const ingredient of ingredients) {
if (ingredient.checked) {
checkedCount++;
}
}
if (checkedCount === 0) {
overall.checked = false;
overall.indeterminate = false;
} else if (checkedCount === ingredients.length) {
overall.checked = true;
overall.indeterminate = false;
} else {
overall.checked = false;
overall.indeterminate = true;
}
}
π λΌλμ€ λ°μ€
λΌλμ€ λ²νΌ vs 체ν¬λ°μ€:
- λΌλμ€ λ²νΌ: μ¬λ¬ μ΅μ μ€ νλλ§ μ ν
- 체ν¬λ°μ€: μ¬λ¬ μ΅μ μ€ μ¬λ¬ κ° μ ν κ°λ₯
κ° (value μμ±):
- λΌλμ€ λ²νΌμ κ°μ λνλ΄λ λ¬Έμμ΄
- μ¬μ©μμκ²λ νμλμ§ μμ
- μ νλ λΌλμ€ λ²νΌ μλ³μ μ¬μ©
λΌλμ€ κ·Έλ£Ή:
- λμΌν name μμ±μ κ°μ§ λΌλμ€ λ²νΌλ€μ κ·Έλ£Ή
- κ·Έλ£Ή λ΄μμ νλμ λΌλμ€ λ²νΌλ§ μ ν κ°λ₯
- μ¬λ¬ λΌλμ€ κ·Έλ£Ή μ¬μ© κ°λ₯ (κ° κ·Έλ£Ήμ κ³ μ ν name νμ)
<input type="radio" name="contact" value="email"> Email
<input type="radio" name="contact" value="phone"> Phone
<input type="radio" name="contact" value="mail"> Mail
The resulting HTML looks like this:
```html
<form>
<fieldset>
<legend>Please select your preferred contact method:</legend>
<div>
<input type="radio" id="contactChoice1" name="contact" value="email" />
<label for="contactChoice1">Email</label>
<input type="radio" id="contactChoice2" name="contact" value="phone" />
<label for="contactChoice2">Phone</label>
<input type="radio" id="contactChoice3" name="contact" value="mail" />
<label for="contactChoice3">Mail</label>
</div>
<div>
<button type="submit">Submit</button>
</div>
</fieldset>
</form>
- name μμ±:
- μΈ κ°μ λΌλμ€ λ²νΌ λͺ¨λ contactλ‘ μ€μ λμ΄ νλμ κ·Έλ£Ήμ νμ±
- value μμ±:
- κ° λΌλμ€ λ²νΌμ κ·Έλ£Ή λ΄μμ κ³ μ νκ² μλ³λλ value κ°μ κ°μ§
- id μμ±:
- κ° λΌλμ€ λ²νΌμ κ³ μ ν idλ₯Ό κ°μ§λ©°, μ΄λ <label> μμμ for μμ±μ ν΅ν΄ λΌλμ€ λ²νΌκ³Ό λ μ΄λΈμ μ°κ²°νλ λ° μ¬μ©
- <label> μμ:
- for μμ±μ μ¬μ©νμ¬ κ° λΌλμ€ λ²νΌμ idμ μ°κ²°λμ΄, λ μ΄λΈμ ν΄λ¦νμ λ ν΄λΉ λΌλμ€ λ²νΌμ΄ μ ν
π button
- <button> μμλ HTMLμμ ν΄λ¦ κ°λ₯ν λ²νΌμ μ μ
- μ¬μ©μ μΈν°νμ΄μ€(UI)μμ νΉμ λμμ νΈλ¦¬κ±°νλ λ° μ¬μ©
<a> μμμμ μ°¨μ΄μ
νΉμ§ | <button> | <a> |
---|---|---|
μ©λ | νμ¬ νμ΄μ§ λ΄ μνΈμμ© (νΌ μ μΆ λ±) | λ€λ₯Έ νμ΄μ§/μμΉλ‘ μ΄λ (νμ΄νΌλ§ν¬) |
νΌ λ°μ΄ν° μ μ‘ | κ°λ₯ (κ° κ°μ§) | λΆκ°λ₯ |
μ£Όλ‘ μ¬μ©νλ μν© | μ€ν¬λ¦½νΈ μ€ν | νμ΄μ§ μ΄λ |
ν΅μ¬ μμ±
- type: λ²νΌμ λμ μ ν μ§μ .
- submit (κΈ°λ³Έκ°): νΌ μ μΆ.
- reset: νΌ νλ μ΄κΈ°ν.
- button: μΌλ° λ²νΌ (JavaScriptλ‘ κΈ°λ₯ λΆμ¬).
- menu(μ€νμ ): μ°κ²°λ λ©λ΄λ₯Ό μ½λλ€.
- form (HTML5): <button>μ λͺ μμ μΌλ‘ νΌ(form μμμ id)κ³Ό μ°κ²°. (λ²νΌμ΄ νΌ λ°κΉ₯μ μμ΄λ μ°κ²° κ°λ₯)
- name: νΌ μ μΆ μ μλ²λ‘ μ λ¬λ λ²νΌμ μ΄λ¦.
- value: νΌ μ μΆ μ μλ²λ‘ μ λ¬λ λ²νΌμ κ°.
- disabled: λ²νΌ λΉνμ±ν (ν΄λ¦ λΆκ°).
- autofocus (HTML5): νμ΄μ§ λ‘λ μ λ²νΌμ μλ ν¬μ»€μ€.
μ κ·Όμ± κ³ λ € μ¬ν
- λͺ νν λ μ΄λΈ: λ²νΌμ λͺ©μ μ λνλ΄λ ν μ€νΈ λ μ΄λΈ νμ.
- ARIA μμ±: μ€ν¬λ¦° 리λ μ¬μ©μλ₯Ό μν΄ aria-label, aria-pressed λ± μ¬μ© κ°λ₯.
- μκ°μ νν + ν μ€νΈ: μ΄λ―Έμ§ λ²νΌμ κ²½μ° aria-label λ±μΌλ‘ κΈ°λ₯ μ€λͺ .
<a> νκ·Έλ₯Ό λ²νΌμ²λΌ μ¬μ©νλ κ²μ λ¬Έμ μ
- <a> νκ·Έμ λ³Έλ μλ―Έ(λ§ν¬)λ₯Ό μμ.
- μ€ν¬λ¦° 리λ μ¬μ©μμκ² νΌλ μ λ°.
- μλ§¨ν± μΉμ λΆμ ν©: <button> μ¬μ© κΆμ₯. href="#", href="javascript:void(0)"μ ν¨κ» <a>λ₯Ό μ¬μ©νλ κ²μ μ§μν΄μΌν¨.
π select
<label for="pet-select">Choose a pet:</label>
<select name="pets" id="pet-select">
<option value="">--Please choose an option--</option>
<option value="dog">Dog</option>
<option value="cat">Cat</option>
<option value="hamster">Hamster</option>
<option value="parrot">Parrot</option>
<option value="spider">Spider</option>
<option value="goldfish">Goldfish</option>
</select>
κΈ°λ³Έ μ¬μ©λ²:
- id μμ±μ μ¬μ©νμ¬ <label>κ³Ό μ°κ²°νμ¬ μ κ·Όμ±μ ν₯μ
- name μμ±μ μ¬μ©νμ¬ μλ²λ‘ μ μ‘λ λ°μ΄ν°μ μ΄λ¦μ μ§μ
- <option> μμλ₯Ό μ€μ²©νμ¬ λ©λ΄ μ΅μ μ μ μ
<option> μμ:
- value μμ±μ μ ν μ μλ²λ‘ μ μ‘λ λ°μ΄ν° κ°μ μ§μ
- value μμ±μ΄ μμΌλ©΄ μμ λ΄λΆμ ν μ€νΈκ° κΈ°λ³Έκ°μΌλ‘ μ¬μ©
- selected μμ±μ μ¬μ©νμ¬ νμ΄μ§ λ‘λ μ κΈ°λ³Έ μ ν μ΅μ
μ μ§μ
- selected μμ±μ΄ μμΌλ©΄ 첫 λ²μ§Έ <option> μμκ° κΈ°λ³Έμ μΌλ‘ μ ν
JavaScript:
- HTMLSelectElement κ°μ²΄λ‘ νν
- value μμ±μ μ νλ <option>μ κ°μ ν¬ν¨
<select> μμμ μμ±:
- multiple: μ¬λ¬ μ΅μ μ ν κ°λ₯ μ¬λΆλ₯Ό μ§μ
- size: ν λ²μ νμν μ΅μ μλ₯Ό μ§μ
- required, disabled, autofocus λ± μΌλ°μ μΈ νΌ μ λ ₯ μμ±λ μ¬μ© κ°λ₯
μΆκ° κΈ°λ₯:
- <optgroup> μμλ₯Ό μ¬μ©νμ¬ μ΅μ μ κ·Έλ£Ήν κ°λ₯
- <hr> μμλ₯Ό μ¬μ©νμ¬ μ΅μ μ¬μ΄μ μκ°μ ꡬλΆμ μ μΆκ°ν μ μμ
π list, datalist
list μμ±μ <input> μμμ μλ μμ± κΈ°λ₯μ μ 곡νλ <datalist> μμλ₯Ό μ°κ²°νλ λ° μ¬μ©
- list μμ±μ μν :
- <input> μμμ μ°κ²°ν <datalist> μμμ id κ°μ μ§μ
- <datalist> μμλ <input> μμμ λν 미리 μ μλ μ΅μ λͺ©λ‘μ μ 곡νμ¬ μλ μμ± κΈ°λ₯μ ꡬν
- <datalist> μμμμ κ΄κ³:
- list μμ± κ°μ λμΌν λ¬Έμ λ΄μ μλ <datalist> μμμ idμ μΌμΉμμΌμΌ ν¨
- <datalist> μμλ <option> μμλ€μ ν¬ν¨νμ¬ μλ μμ± μ΅μ λͺ©λ‘μ ꡬμ±
- list μμ±μ μ§μνλ <input> νμ
:
- text, search, url, tel, email, date, month, week, time, datetime-local, number, range, color
- checkbox, radio, file, buttonκ³Ό κ°μ νμ μμλ list μμ±μ΄ 무μλ¨.
- μ¬μ©μ κ²½ν (UX):
- μ¬μ©μκ° <input> μμμ κ°μ μ λ ₯ν λ, <datalist>μ μ μλ μ΅μ λ€μ΄ λλ‘λ€μ΄ ννλ‘ νμλμ΄ μ ννκ±°λ, μ§μ μ λ ₯ν μ μμ
- <datalist>λ μ μ λͺ©λ‘μ μ 곡νλ κ²μ΄λ©°, <select> μμμ²λΌ μ νμ κ°μ νμ§ μμ
- autocomplete μμ±κ³Όμ κ΄κ³:
- listμμ±μ μ¬μ©νλ©΄ autocompleteμμ±μ μ¬μ©ν νμκ° μμ
- list μμ±μ <datalist>λ₯Ό ν΅ν΄ μλ μμ± μ΅μ μ λͺ μμ μΌλ‘ μ 곡νλ λ°λ©΄, autocomplete μμ±μ λΈλΌμ°μ μ μΌλ°μ μΈ μλ μμ± κΈ°λ₯(μ΄μ μ μ λ ₯ν κ° κΈ°λ°)μ μ μ΄
- readonlyμμ±, sizeμμ±κ³Όμ νΈνμ±
- readonlyμμ±μ μ¬μ©νμ¬ μ½κΈ° μ μ©μΌλ‘ μ€μ ν <input>μμλ listμμ±κ³Ό μ°κ²°λ <datalist>κ° λμν¨.
- <input>μ sizeμμ±μΌλ‘ ν¬κΈ°λ₯Ό μ‘°μ ν΄λ,listμμ±κ³Ό μ°κ²°λ <datalist>κ° λμν¨.
<label for="ice-cream-choice">Choose a flavor:</label>
<input list="ice-cream-flavors" id="ice-cream-choice" name="ice-cream-choice">
<datalist id="ice-cream-flavors">
<option value="Chocolate">
<option value="Coconut">
<option value="Mint">
<option value="Strawberry">
<option value="Vanilla">
</datalist>
datalist
- <input> μμμ λν μλ μμ± μ΅μ μ 곡.
- <input> μμμ list μμ±μ <datalist> μμμ idλ₯Ό μ§μ νμ¬ μ°κ²°
- <option> μμ μ¬μ©:
- <datalist> λ΄λΆμ <option> μμλ₯Ό μ¬μ©νμ¬ μ΅μ λ€μ μ μ
- value μμ±: <input>μ μ€μ λ‘ μ λ ₯λ κ°.
- label μμ± (μ ν μ¬ν): μ¬μ©μμκ² λ³΄μ¬μ€ μ€λͺ (λΈλΌμ°μ μ λ°λΌ λ€λ₯΄κ² νμλ μ μμ).
- <option> μμμ ν μ€νΈ λ΄μ©λ value λμ μ¬μ©λ μ μμ.
- <select> μμμμ μ°¨μ΄μ :
- <select>: μ¬μ©μκ° λ°λμ μ£Όμ΄μ§ μ΅μ μ€ νλλ₯Ό μ ν
- <datalist>: μ¬μ©μλ μ΅μ μ μ ννκ±°λ, μ§μ μ λ ₯ν μ μμ.
- μ κ·Όμ± κ³ λ €μ¬ν
- <datalist>λ₯Ό μ¬μ©ν λ μ€ν¬λ¦° 리λ μ¬μ©μμκ² <input>μ μλμμ± κΈ°λ₯μ΄ μμμ μλ €μ£Όμ΄μΌ ν¨
- aria-autocompleteμμ±μ ν΅ν΄ μλμμ± λμ λ°©μμ λͺ μν μ μμ
- both: λͺ©λ‘κ³Ό μΈλΌμΈ νν λͺ¨λ μ 곡
- inline: ν μ€νΈλ₯Ό νμ΄ν ν λ μλμμ±
- list: 리μ€νΈμμ μ ν
- none : μλμμ± λμ μμ.
- μμ±
- <datalist>μμλ μ μ νΉμ±μ κ°μ§
<label for="myBrowser">Choose a browser from this list:</label>
<input list="browsers" id="myBrowser" name="myBrowser">
<datalist id="browsers">
<option value="Chrome">
<option value="Firefox">
<option value="Internet Explorer">
<option value="Opera">
<option value="Safari">
<option value="Microsoft Edge">
</datalist>
π file
<input type="file" id="filepicker" name="fileList" multiple />
<output id="output"></output>
const output = document.getElementById("output");
const filepicker = document.getElementById("filepicker");
filepicker.addEventListener("change", (event) => {
const files = event.target.files;
output.textContent = "";
for (const file of files) {
output.textContent += `${file.name}: ${file.type || "μ μ μμ"}\n`;
}
});
type μμ±μ μ μΌν μ ν¨μ± κ²μ¦ μλ¨μΌλ‘ μ¬μ©νλ 건 κΆμ₯νμ§ μμ
π disabled, readonly
- disabled -> 무μ©μ§λ¬Ό
- disabled μμ±μ΄ μμ κ²½μ° ν΄λΉ μμλ μμ νκ±°λ ν¬μ»€μ€λ₯Ό λ§μΆ μ μμ.
- νΌμ ν΅ν΄ μ μΆλ μλ μμ
- <button>, <fieldset>, <optgroup>, <option>, <select>, <textarea>, <input> μμ μ§μ
- readonly -> κ³ μ κ° μ μ§
- disabledμ readonlyμ μ°¨μ΄λ μ½κΈ° μ μ©μΌλ‘ μ§μ λ 컨νΈλ‘€μ μ¬μ ν λμνκ³ ν¬μ»€μ€κ° κ°λ₯νλ€λ λ°λ©΄,
- λΉνμ±νλ 컨νΈλ‘€μ ν¬μ»€μ€λ₯Ό λ°κ±°λ νΌκ³Ό ν¨κ» μ μΆλμ§ μκ³ μΌλ°μ μΌλ‘ νμ±νλ λκΉμ§ 컨νΈλ‘€λ‘μ λμνμ§ μμ
- λΉνμ±νλ νλλ κ·Έ κ°μ΄ λ³κ²½λ μ μκΈ° λλ¬Έμ, requiredλ disabled μμ±μ΄ μ§μ λ μ λ ₯ νλμ μ무 μν₯λ λ―ΈμΉμ§ μμ
- μμλ€μ΄ λ³κ²½ λΆκ°λ₯νκ² λλ―λ‘ pattern κ³Ό κ°μ λλΆλΆμ λ€λ₯Έ μμ±λ€λ 컨νΈλ‘€μ΄ νμ±νλ λκΉμ§ μν₯μ λ―ΈμΉμ§ μμ
μ°Έκ³ : disabled μμ±μ΄ μ§μ λ μ λ ₯ νλμλ required μμ±μ μ¬μ©ν μ μμ΅λλ€.
disabled μ μ©μ±
- λΈλΌμ°μ λ λΉνμ±νλ νΌ μ»¨νΈλ‘€λ€μ νμμΌλ‘ νμ
- λΉνμ±νλ νΌ μ»¨νΈλ‘€μ λ³κ²½λκ±°λ νΌκ³Ό ν¨κ» μ μΆλμ§ μμ
- λ§μ°μ€ ν΄λ¦μ΄λ ν¬μ»€μ€μ κ΄λ ¨λ λΈλΌμ°μ§ μ΄λ²€νΈλ₯Ό μμ νμ§ μμ
- μ§μνλ μμμ μ‘΄μ¬νλ κ²½μ° :disabled μμ¬ ν΄λμ€κ° μ μ©
- ν΄λΉ μμ±μ΄ μ§μ λμ§ μμμ κ²½μ°μλ :enabled μμ¬ ν΄λμ€κ° μ μ©
- μμκ° λΉνμ±ν μμ±μ μ§μνμ§ μλ κ²½μ°μλ ν΄λΉ μμ±μ΄ μ΄λ€ ν¨κ³Όλ κ°μ§ μμΌλ©°, :disabled μ :enabled μμ¬ ν΄λμ€λ μ μ©λμ§ μμ
readonly
The Boolean readonly attribute, when present, makes the element not mutable, meaning the user can not edit the control.
- the user can not edit the input, the element does not participate in constraint validation.
- is supported by text, search, url, tel, email, password, date, month, week, time, datetime-local, and number input
'π» FE > π HTML & CSS' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
html data-* (0) | 2025.03.26 |
---|---|
πΎ CSS :not()κ³Ό :has()μ μ‘°ν© (3) | 2025.03.12 |
HTML μ μμμ± νλ°©νκΈ° π (0) | 2025.03.07 |
μΉ νμ΄μ§ λ©νλ°μ΄ν°μ λνμ¬ μμ보기 π (0) | 2025.03.06 |
01. Markup μΈμ΄μ Markdown μΈμ΄ λΉκ΅ (2) | 2025.03.04 |