728x90
λ°μν
[ <form>μμ κ²μ μμ ]
<from>μμ κ²μ μν μ ν <input> λ€μ΄κ°λ ννλ‘ κ΅¬μ±νλ€.
- # κ²μ μμλ₯Ό λ§λ€κΈ° μν΄μ input νκ·Έ
π₯ problem π₯
- form μμμ μλ²λ‘ μ μΆλ λ°μ΄ν°λ‘ μ¬μ©μμκ² μ λ ₯λ°μ κ²μ΄κΈ° λλ¬Έμ μ μΌν΄μΌνλ€.
- inputμ μ¬μ©μκ° κ²μνλ €λ λ°μ΄ν° λν μ μΌν΄μΌνλ€.
π‘ solution π‘
- form νκ·Έμ input νκ·Έμ μ μΌν¨μ μλ―Ένλ id μμ± μΆκ°
<form id="search-form">
<input type="text" id="search" class="input--text" placeholder="Search GitHub">
</form>
- # λ°μ΄ν° μ μ‘μ μν submit κΈ°λ₯ input νκ·Έ
π₯ problem π₯
- inputμΌλ‘ λ°μ΄ν°λ₯Ό μ λ ₯λ°μμ§λ§ μ μ‘νλ λ²νΌμ΄ μ‘΄μ¬νμ§ μλλ€.
π‘ solution π‘
- submit μ νμ input νκ·Έλ₯Ό μμ±ν΄μ€λ€.
[ μ μ‘λ²νΌ (Submit) ]
- ν΄λ¦μ, μλ²λ‘ λ°μ΄ν°λ₯Ό μ μ‘νλ€.
- μ μΆμ© κΈ°λ₯μΌλ‘μ νμν μμμ§λ§ CSSλ₯Ό ν΅ν΄μ νλ©΄μμ μ¨κ²¨μ€ κ²μ΄λ€.
// νΌ νκ·Έλ‘ λ°μ΄ν°κ° μ μ‘λ λλ post λ°©μ
<form id="search-form" method="post" action="">
<input type="text" id="search" class="input--text" placeholder="Search GitHub">
<input type="submit" value="Submit">
</form>
728x90
λ°μν
'side-project > GitHub λ°λΌ λ§λ€κΈ°' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[CSS] κ³΅ν΅ μμ±κ³Ό position κΈ°μ€ μ€μ (0) | 2022.04.11 |
---|---|
[CSS] order μμ±κ³Ό νμ μ νμ (0) | 2022.04.10 |
[CSS] λ‘κ³ μ μ (0) | 2022.04.07 |
[CSS] a νκ·Έ ν΄λ¦ λ²μ νμ₯μν€κΈ° (0) | 2022.04.06 |
[CSS] μμ μμ κ°μ΄λ° μ λ ¬ λ° μμ§ μ λ ¬ (0) | 2022.04.05 |
λκΈ