+ 3
What is the use of size attribute in select element
<!DOCTYPE html> <html> <body> <h2>Allow Multiple Seletcions</h2> <p>Use the multiple attribute to allow the user to select more than one value.</p> <form action="/action_page.php"> <select name="cars" size="4" multiple> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="fiat">Fiat</option> <option value="audi">Audi</option> </select> <br><br<select name="cars" size="4" multiple> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="fiat">Fiat</option> <option value="audi">Audi</option> </select>
1 Antwort
0
"The size attribute specifies the number of visible options in a drop-down list.
If the value of the size attribute is greater than 1, but lower than the total number of options in the list, the browser will add a scroll bar to indicate that there are more options to view."
https://www.w3schools.com/tags/att_select_size.asp