iT邦幫忙

2021 iThome 鐵人賽

DAY 27
0
自我挑戰組

html與css粗淺新手入門教學系列 第 27

html 多選題

昨天說了單選題,今天來說說多選題
多選題比單選題還要簡單,邏輯上來說就是每個選項都只有勾與不勾兩種狀態
將昨天的type屬性改為checkbox,並且不需要定義name

        多選題題目1<br>
        <input type="checkbox"> a<br>
        <input type="checkbox"> b<br>
        <input type="checkbox"> c<br>
        <input type="checkbox"> d<br>

https://ithelp.ithome.com.tw/upload/images/20210927/20140086GqSAzneC3M.jpg
如果加上checked屬性就可以讓網頁剛打開時就有預設勾好的選項

        多選題題目1<br>
        <input type="checkbox" checked="checked"> a<br>
        <input type="checkbox"> b<br>
        <input type="checkbox"> c<br>
        <input type="checkbox"> d<br>

https://ithelp.ithome.com.tw/upload/images/20210927/20140086Bp9VxVhnoA.jpg


上一篇
html 選項
下一篇
html 下拉式選單
系列文
html與css粗淺新手入門教學30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言