HTML 5 formフォームラベル

10059 ワード

フォーム・ラベルは、ユーザーが入力したデータをバックグラウンドに渡し、データのインタラクションを行うことができます.
コードの例:

<html>
<head>
    <title>    title>
head>
<body>
<form method="post" action="xxx.php"> 
    <label for="username">label>
    <input type="text" name="username" id="username" value="      ">
    <br>
    <label for="pass">     :label>
    <input type="password" name="pass" value="">
    <br>
    <textarea cols="31" rows="10" >       ...textarea>
    <br>
    <label>label>
    <label for="sexMan">label>
    <input type="radio" name="sex" value="0" id="sexMan">
    <label for="sexWM">label>
    <input type="radio" name="sex" value="1" id="sexWM">
    <br>
    <label>label>
    <label>  label>
    <input type="checkbox"  checked="checked" name="loves" value="0">
    <label>  label>
    <input type="checkbox" name="loves" value="1">
    <label>  label>
    <input type="checkbox" name="loves" value="2">
    <br>
    <label>  :label>
    <select multiple="multiple">
      <option value="  ">  option>
      <option value="  ">  option>
      <option value="  ">  option>
    select>
    <br>
    <input type="submit" name="submit" value="  ">
    <input type="reset" name="reset" value="  ">
form>
body>
html>

効果:
ラベルの紹介:
<form   method="    "   action="     ">
method:        (get/post)。
action:               ,    PHP  xxx.php

<input>     
type: type="text" ,         ;
           type="password" ,          。
            type="radio"  ,      
            type="checkbox"  ,      (type=  /  ,     checked="checked"      )
           type="submit" ,       ,value        
           type="reset" ,       ,value        
name:      ,      。
value:           。(        )

<textarea  rows="  " cols="  ">    textarea>

<select>
      <option value="  ">  option>//value         ,             
select>
  multiple="multiple"      , Ctrl    

<label for="  id  ">   for  ,             ,               ,