Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
<!DOCTYPE html> <html> <body> <h2>The select Element</h2> <p>The select element defines a drop-down list:</p> <form action="/action_page.php"> <label for="cars">Choose a car:</label> <select id="cars" name="cars"> <option value="volvo">Volvo</option> <...
Theonselectattribute is part of theEvent Attributes, and can be used on any HTML elements. ElementsEvent All HTML elementsonselect Example Input Example Execute a JavaScript after some text has been selected in an <input> element: <inputtype="text"onselect="myFunction()"value="Hello world!"...
<option value="">None</option> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> <br><br> <input type="submit" value="Submit"> </form> </body> </html> ...
<h1>The option element</h1> <label for="cars">Choose a car:</label> <select id="cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="opel">Opel</option> <option value="audi">Audi</option> </select> </body> </html> ...
<!DOCTYPE html> <html> <body> <h1>The select element</h1> <p>The select element is used to create a drop-down list.</p> <form action="/action_page.php"> <label for="cars">Choose a car:</label> <select name="cars" id="cars"> <option value="volvo">Volvo</...
<select id="cars" name="cars" size="3"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="opel">Opel</option> <option value="audi">Audi</option> </select> <br><br> <input type="submit" value="Submit"> </form> </body> </html> ...
<option value="opel">Opel</option> <option value="audi">Audi</option> </select> <br><br> <input type="submit" value="Submit"> </form> <p>Hold down the Ctrl (windows) or Command (Mac) button to select multiple options.</p> </body> </html> ...
<option value="saab">Saab</option> </optgroup> <optgroup label="German Cars"> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </optgroup> </select> <br><br> <input type="submit" value="Submit"> </form> </body> </html> ...