HTML
讓使用者可以從一堆選項中選擇出一個或多個選項。 <>select> 本身做為選單的容器,在裡面用 <>option> 標籤來建立個別選項。
<>select> <>option value="A" >select 1<>/option> <>option value="B" selected >select 2<>/option> <>option value="C" >select 3<>/option> <>option value="D" >select 4<>/option> <>/select>
<>select multiple > <>option value="A" >select 1<>/option> <>option value="B" >select 2<>/option> <>option value="C" >select 3<>/option> <>option value="D" >select 4<>/option> <>/select>
<>select size="2" > <>option value="A" >select 1<>/option> <>option value="B" >select 2<>/option> <>option value="C" >select 3<>/option> <>option value="D" >select 4<>/option> <>option value="E" >select 5<>/option> <>/select>
<>select> <>option style="display:none;" >請選擇<>/option> <>optgroup label="1 to 2"> <>option value="A" >select 1<>/option> <>option value="B" >select 2<>/option> <>optgroup label="3 to 4"> <>option value="C" >select 3<>/option> <>option value="D" >select 4<>/option> <>/select>
<>select> <>option style="display:none;" >請選擇<>/option> <>option value="A" >select 1<>/option> <>option value="B" >select 2<>/option> <>option value="C" >select 3<>/option> <>option value="D" >select 4<>/option> <>/select>
<>select onchange="this.selectedIndex=0" > <>option style="display:none;" >請選擇<>/option> <>option value="A" >select 1<>/option> <>option value="B" >select 2<>/option> <>option value="C" >select 3<>/option> <>option value="D" >select 4<>/option> <>/select>
沒有留言:
張貼留言