欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

HTML 下拉列表框

程序员文章站 2022-03-27 12:37:52
...
               
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head>  <title> new document </title>  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />  <meta name="author" content="" />  <meta name="keywords" content="" />  <meta name="description" content="" />  <link rel="stylesheet" type="text/css" href="" />  <style type="text/css"></style>  <script type="text/javascript"></script> </head> <body>   <table width="400" align="center" border="1">  <tr>   <td>籍贯A</td>   <td>     <select name="jiguan">        <!--下拉列表框-->      <option value="bejing">北京</option>      <option value="heibei" selected="selected">河北</option>      <option value="shanghai">上海</option>     </select>   </td>  </tr>  <tr>   <td>籍贯B</td>   <td>     <select name="address">     <!--分组下拉列表框-->      <optgroup label="北京">       <option value="haidian">海淀</option>       <option value="dongcheng">东城</option>       <option value="xicheng">西城</option>       <option value="chaoyang">朝阳</option>      </optgroup>      <optgroup label="河北">       <option value="baodin">保定</option>       <option value="shijiazhuang">石家庄</option>       <option value="langfang">廊坊</option>       <option value="tangshan">唐山</option>      </optgroup>     </select>   </td>  </tr>  <tr>   <td>水果</td>   <td>     <select name="fruit" multiple="multiple" size="3">  <!--可以多选的下拉列表框-->      <option value="apple">苹果</option>      <option value="banana">香蕉</option>      <option value="pear"></option>      <option value="orange" selected="selected">桔子</option>      <option value="watermelon">西瓜</option>      <option value="strawberry">草莓</option>     </select>   </td>  </tr>   </table> </body></html>