HTML13:按钮和多选框

表单元素格式

属性 说明
type 指定元素的类型。text、password、 checkbox、 radio、submit、reset、file、hidden、image 和button,默认为text
name 指定表单元素的名称
value 元素的初始值。type为radio时必须指定一个值
size 指定表单元素的初始宽度。当type为text 或password时,表单元素的大小以字符为单位。对于其他类型,宽度以像素为单位
maxlength type为text或password时,输入的最大字符数
checked type为text或password时,指定按钮是否是被选中
DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录注册title>
head>
<body>
<h1>注册h1>

<form method="post" action="6.表格.html" >

    <p>名字:<input type="text" name="username" maxlength="8" size="30">p>
    <p>密码:<input type="password" name="pwd" maxlength="20" size="30">p>
    
    <p>性别:
        <input type="radio" value="boy" name="sex"/><input type="radio" value="girl" name="sex"/><input type="radio" value="unknown" name="sex"/>未知
    p>
    <p>爱好:
        <input type="checkbox" value="sleep" name="hobby">睡觉
        <input type="checkbox" value="code" name="hobby">敲代码
        <input type="checkbox" value="chat" name="hobby">聊天
        <input type="checkbox" value="game" name="hobby">游戏
    p>
    
    <p>按钮:
        <input type="button" name="btn1" value="点击V50"><br/>
        <input type="image" src="../resources/image/2.jpg">
    p>
    <p>
        <input type="submit">
        <input type="reset" value="清空表单">
    p>
form>
body>
html>

HTML13:按钮和多选框_第1张图片

你可能感兴趣的:(java,javascript,前端,html5)