运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>The select form attribute</h1> <p>The form attribute specifies which form the drop-down list belongs to:</p> <form action="/action_page.php" id="carform"> <label for="fname">Firstname:</label> <input type="text" id="fname" name="fname"> <input type="submit"> </form> <br> <label for="cars">Choose a car:</label> <select id="cars" name="carlist" form="carform"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="opel">Opel</option> <option value="audi">Audi</option> </select> <p>The drop-down list is defined outside the form element, but will be submitted with the form.</p> </body> </html>