drop down list box

Drop-down lists are also often used in web pages, which can effectively save web page space. You can select both single and multiple selections. The following code:

QQ截图20161207112403.png

Explanation:

1, value:

QQ截图20161207112444.png

2, selected="selected":

Set the selected="selected" attribute, then this option is selected by default.

Results displayed in the browser:

QQ截图20161207112504.png

Continuing Learning
||
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>下拉列表框</title> </head> <body> <form action="save.php" method="post" > <label>爱好:</label> <select> <option value='看书'>看书</option> <option value='旅游' selected="selected">旅游</option> <option value='运动'>运动</option> <option value='购物'>购物</option> </select> </form> </body> </html>
submitReset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!