提交的表單包含內容多個,怎想要實際每個內容都實現(xiàn)點擊前面標題光標在輸入框
我在這個表單里寫了多個內容。只有第一個用戶名點擊前面文字之后光標在輸入框?其他都沒有
<!DOCTYPE html>
<html>
<head>
? ? <meta charset="UTF-8">
? ? <title>提交按鈕</title>
</head>
<body>
? ?<form method="post" action="/.php">
? ? <label>
? ? 用戶名:<input type="text" name="wenben" placeholder="請輸入用戶名"? ><br/>
? ? 密 碼:<input? type="possword" name="mima" placeholder="請輸入密碼"><br/>
? ? 特長:
? ? ? ? <input type="radio" name="techang" >唱歌
? ? ? ? <input type="radio" name="techang">跳舞
? ? ? ? <input type="radio" name="techang" checked="checked">畫畫
? ? ? ? <input type="radio" name="techang">學習
? ? ? ? <br />
? ? 興趣愛好:
? ? ? ? <input type="checkbox" name="aihao">旅游
? ? <input type="checkbox" name="aihao">睡覺
? ? <input type="checkbox" name="aihao">玩耍
? ? <input type="checkbox" name="aihao" checked="checked">吃飯<br/>
? ? 地點:
? ? <select>
? ? <option>成都</option>
? ? <option>拉薩</option>
? ? <option>重慶</option>
? ? <option selected="selected">云南</option>
? ? </select>
? ? <br/>
? ? 留下你的小意見:<br/>
? ? <textarea placeholder="請輸入內容"></textarea><br/>
? ? <input type="submit"velue="提交">
? ? </label>
? ?</form>
</body>
<?/html>
2021-04-12
你得為每一個input前面加上label標簽? 并綁定id才行,如下示例:
<label for="wenben">用戶名:</label>
? ? <input type="text" id="wenben" name="wenben" placeholder="請輸入用戶名"? ><br/>
? ? <label for="mima">密 碼:</label>
? ? <input? type="possword" id="mima" name="mima" placeholder="請輸入密碼"><br/>
2023-12-15
你這不是剛開始學吧?我都還看不懂你都寫這么多了,壓力好大????