国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Basic HTML Tutorial: Radio Buttons and Check Buttons in Forms

Radio button

## Syntax format: <input type = “radio” attribute = “value” />

Commonly used attributes

  • Name: The name of the element

  • Value: The value of the element, the value The data will be sent to the server.

  • Checked: Which item is selected by default. For example: checked = “checked”

Note: Only one of a set of radio buttons can be selected, but the value of the name must be consistent. For example: name = “sex”

The radio button user cannot enter the content himself, the user can only select, so it must refer to the default value value.


Check box

## Syntax format:

<input type = "checkbox" attribute = "value" />

Common attributes

    Name: the name of the element
  • Value: The value of the element
  • Checked: Checked by default. For example: checked = "checked"
Note: The check box is also a set of options, so the value of the name must be consistent. In PHP, use an array to get the values ??of multiple names with the same name.

You can select multiple check boxes at the same time, or you can select none.

Let’s enrich our first example

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>用戶注冊</title>
    </head>
    <body>
        <font size="5" color="red">歡迎注冊php.cn</font>
        <form name="user" method="get" action="" >
            用戶名:<input type="text" name="username"/>
            <br/>
            密碼:<input type="password" name="userpwd"/>
            <br/>
            性別:<input type="radio" name="sex" value="男" checked=checked>男
            <input type="radio" name="sex" value="女">女
            <br/>
            愛好:<input type="checkbox" name="hobby" value="運動">運動
            <input type="checkbox" name="hobby" value="看電影">看電影
            <input type="checkbox" name="hobby" value="編程" checked="checked">編程
            <input type="checkbox" name="hobby" value="宅著">宅著
            <br/><input type="submit" value="提交信息"/>
        </form>
    </body>

Is there too much content? Let’s continue adding to the next section

Continuing Learning
||
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>用戶注冊</title> </head> <body> <font size="5" color="red">歡迎注冊php.cn</font> <form name="user" method="get" action="" > 用戶名:<input type="text" name="username"/> <br/> 密碼:<input type="password" name="userpwd"/> <br/> 性別:<input type="radio" name="sex" value="男" checked=checked>男 <input type="radio" name="sex" value="女">女 <br/> 愛好:<input type="checkbox" name="hobby" value="運動">運動 <input type="checkbox" name="hobby" value="看電影">看電影 <input type="checkbox" name="hobby" value="編程" checked="checked">編程 <input type="checkbox" name="hobby" value="宅著">宅著 <br/><input type="submit" value="提交信息"/> </form> </body>
submitReset Code