iT邦幫忙

2021 iThome 鐵人賽

DAY 26
0
自我挑戰組

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

html 選項

今天來說要如何用html做出單選題
語法如下

        單選題題目1<br>
        <input type="radio" name="one"> a<br>
        <input type="radio" name="one"> b<br>
        <input type="radio" name="one"> c<br>
        <input type="radio" name="one"> d<br>

<br>的功能是換行,以下是網頁效果
https://ithelp.ithome.com.tw/upload/images/20210926/20140086V0L75D1fYe.jpg
同一題的name內容必須一樣,否則會有兩題內只能選一個選項的結果
寫入兩題的效果

        單選題題目1<br>
        <input type="radio" name="one"> a<br>
        <input type="radio" name="one"> b<br>
        <input type="radio" name="one"> c<br>
        <input type="radio" name="one"> d<br>
        單選題題目2<br>
        <input type="radio" name="two"> a<br>
        <input type="radio" name="two"> b<br>
        <input type="radio" name="two"> c<br>
        <input type="radio" name="two"> d<br>

https://ithelp.ithome.com.tw/upload/images/20210926/20140086CW36tWSfCw.jpg


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

尚未有邦友留言

立即登入留言