input μ λ ₯ νκ·Έ μ¬ν
<form>
κ³Ό ν¨κ» μ¬μ©νλ <input />
input νκ·Έλ λλΆλΆ <form>
(μμνΌ) νκ·Έμ ν¨κ» μ¬μ©ν©λλ€.
μλ₯Ό λ€μ΄ νμκ°μ
νλ©΄μμ input νκ·Έλ‘ μ¬μ©μμκ² λ°μ΄ν°λ₯Ό μ
λ ₯μ λ°κ³ , <form>
νκ·Έλ‘ μ
λ ₯ λ°μ λ°μ΄ν°λ₯Ό μλ²μ μ μ‘ν©λλ€.
<form action="/submit" method="post"> <input type="text" name="username" placeholder="μ¬μ©μ μ΄λ¦" /> <input type="password" name="password" placeholder="λΉλ°λ²νΈ" /> <input type="submit" value="μ μΆ" /> </form>
μ λ ₯νΌμ λν λ μμΈν λ΄μ©μ λ€μ μμ μμ λ€λ£¨λλ‘ νκ² μ΅λλ€.
label
νκ·Έ νμ©
label
νκ·Έλ input μ
λ ₯λμ μ€λͺ
μ΄λ μ λͺ©μ λνλ
λλ€.
label νκ·Έλ₯Ό μ¬μ©ν λλ input νκ·Έμ id
μμ±κ³Ό label νκ·Έμ for
μμ±μ κ°μ κ°μΌλ‘ μ§μ ν΄μΌ ν©λλ€.
<label for="username">μ¬μ©μ μ΄λ¦:</label> <input type="text" id="username" name="username" />
μ ν¨μ± κ²μ¬ (Validation)
μ ν¨μ± κ²μ¬λ μ λ ₯λ μ λ³΄κ° μ¬λ°λ₯Έμ§ νμΈνλ κ²μ λ»ν©λλ€.
μλ inputμ required
μμ±μ μ¬μ©ν΄ inputμ΄ κ°μ κ°κ³ μλμ§ μ ν¨μ±μ κ²μ¬ν©λλ€.
<input type="email" name="useremail" required />
input νκ·Έμ ν¨κ» μ ν¨μ± κ²μ¬λ₯Ό μν΄ μ¬μ©ν μ μλ μμ±μ 무μμΈκ°μ?
readonly
disabled
required
hidden
Lecture
AI Tutor
Publish
Design
Upload
Notes
Favorites
Help