見出し画像

100日後にWebエンジニアになるおじさん~5日目~

学んだこと

  • form要素について


form要素について

<form action="" method="get" accept-charset="utf-8">
        <label for="username">ユーザー名</label>
<input type="text" name="username" id="username" placeholder="ユーザー名">


<p>
    <label for="password">パスワード</label>
    <input type="password" name="password" id="password" placeholder="パスワード">
</p>
<P>
    <button type="submit">登録</button>
</P>
    </form>

form要素というのは入れ物のことで実際に何か入力させたい場合はinputのタイプを指定しなければならない。inputだけだと何を入力させるか分からないので「何のための」formか理解できるようにlabel要素がある。

いいなと思ったら応援しよう!