第6章表单标签

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>input-url</title>【input的type属性设置为url,则表示该输入框的类型为网址

<title>input-email</title>【Input的type属性设置为email,则表示该输入框的类型为邮箱
</head>

<body>
    <form method="post" action="save.php">把浏览者输入的数据传送到服务器端

<form method="传送方式" action="服务器文件">
        <label for="username">用户名:</label>
        <input type="text" name="username" id="username" value="" />
        <label for="pass">密码:</label>
        <input type="password" name="pass" id="pass" value="" />
        <input type="submit" value="确定" name="submit" />
        <input type="reset" value="重置" name="reset" />

 <form method="post" action="save.php">
        账户:<input type="text【文本输入】" name="myname"/>
        <br>

 <input type="text" placeholder="请输入用户账号">【放提示的输入信息
        密码:<input type="password【密码输入】" name="pass"/>

                <input type="number"> 【只允许填数字

 <textarea cols【】="50" rows【】="10">在这里输入内容...</textarea>当用户需要在表单中输入大段文字时,需要用到文本输入域

<label>性别:</label>(单选框,选择框)
        <label>男</label>
        <input type="radio" value="1" name="gender" />
type="radio" 时,控件为单选框

   当 type="checkbox" 时,控件为复选框

        <label>女</label>

        <input type="radio" value="2" name="gender" />

<select>
            <option value="看书">看书</option>
            <option value="旅游" selected="selected">旅游</option>
            <option value="运动">运动</option>
            <option value="购物">购物</option>
        </select>

select标签里面只能放option标签,表示下拉列表的选项。

<form method="post" action="save.php">

 type:只有当type值设置为submit时,按钮才有提交作用

value按钮上显示的文字 


        <label for="myName">姓名:</label>
        <input type="text" value=" " name="myName " />
        <input type="submit" value="提交" name="submitBtn" />
    </form>

    </form>
</body>

</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值