フォームの練習その1

何回か打ち込んで見ないで打てるようにする。

お問い合わせフォーム

<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>お問い合わせ</title>
</head>
<body>
<h1>お問い合わせフォーム</h1>
<form action="#" method="post">
<p>名前:<input type="text" name="name" size="20" maxlength="10" value="お名前"></p>
<p>内容:<textarea name="subject" rows="5" cols="40">お問い合わせ内容</textarea></p>
<p><input type="submit" value="送信"></p>
</form>
</body>
</html>

チェックボックス

<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>チェックボックス</title>
</head>
<body>
<h1>チェックボックス</h1>
<form action="#" method="post">
<p>スマートフォン:<label><input type="checkbox" name="mobile" value="1" checked>iphone</label>
<label><input type="checkbox" name="mobile" value="2" checked>Android</label>
<label><input type="checkbox" name="mobile" value="3" checked>その他</label>
<p><input type="submit" value="送信"></p>
</form>
</body>
</html>

ラジオボタン

<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>ラジオボタン</title>
</head>
<body>
<h1>ラジオボタン</h1>
<form action="#" method="post">
<p>性別:<label><input type="radio" name="sex" value="male" checked>男性</label>
<label><input type="radio" name="sex" value="female">女性</label>
</p>
<p><input type="submit" value="送信"></p>
</form>
</body>
</html>