HTML5学习(7) form及input新属性

<!DOCTYPE HTML>
<body>

    <!--新的 form 属性:
        autocomplete     自动完成       
        novalidate       属性规定在提交表单时不应该验证 form 或 input 域。
    -->
    <!--新的 input 属性:
        autocomplete         自动完成
        autofocus            在页面加载时,域自动地获得焦点。
    -->
    <!--form 允许表单某元素在列表区域外-->
    <form action="demo_form.asp" method="get" id="user_form">
    First name:<input type="text" name="fname" />
    <input type="submit" />
    </form>
    Last name: <input type="text" name="lname" form="user_form" />
    <!--
        form overrides (formaction, formenctype, formmethod, formnovalidate, formtarget)
        重写表单属性  适用于submit,image
    -->
    <form action="demo_form.asp" method="get" id="user_form">
    First name:<input type="text" name="fname" />
    <input type="submit" />
    </form>
    Last name: <input type="text" name="lname" form="user_form" />
    
    <!--height 和 width 只属于image类型-->
    <input type="image" src="img_submit.gif" width="99" height="99" />
    
    <!--list属性        指定的datalist 是输入域的选项列表。-->
    Webpage: <input type="url" list="url_list" name="link" />
    <datalist id="url_list">
    <option label="W3Schools" value="http://www.w3school.com.cn" />
    <option label="Google" value="http://www.google.com" />
    <option label="Microsoft" value="http://www.microsoft.com" />
    </datalist>
    
    <!--min, max 和 step  适用于 date pickers、number 以及 range-->
    <!--multiple 允许多个值(多文件上传)-->
    Select images: <input type="file" name="img" multiple="multiple" />
    
    <!--pattern (regexp)-->
    Country code: <input type="text" name="country_code" pattern="[A-z]{3}" title="Three letter country code" />
    
    <!--placeholder 描述输入域所期待的值-->
    <input type="search" name="user_search"  placeholder="Search W3School" />
    
    <!--required 非空-->
    Name: <input type="text" name="usr_name" required="required" />
</body>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值