Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to 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>