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.
<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> <option value="saab"...
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!"...
<!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</...
<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> ...
<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> ...
<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> ...
<html> <body> <h1>The select multiple attribute</h1> <p>The multiple attribute specifies that multiple options can be selected at once:</p> <form action="/action_page.php"> <label for="cars">Choose a car:</label> <select name="cars" id="cars" multiple> <option va...
<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> ...