zoukankan      html  css  js  c++  java
  • html fieldset标签

    <form>
    	<fieldset>
    	<legend>Contact</legend>
    	<label for='fullname'>Name </label>
    	<input id="fullname" name="fullname" /type="text"/>
    	<input name="contactForm" type="submit"  value="submit"/>
    	</fieldset>
    </form>
    	
    

      定义和用法

    fieldset 元素可将表单内的相关元素分组。

    <fieldset> 标签将表单内容的一部分打包,生成一组相关表单的字段。

    当一组表单元素放到 <fieldset> 标签内时,浏览器会以特殊方式来显示它们,它们可能有特殊的边界、3D 效果,或者甚至可创建一个子表单来处理这些元素。

    <fieldset> 标签没有必需的或唯一的属性。

    <legend> 标签为 fieldset 元素定义标题。

        The for attribute in the <label> tag links to the <input> tag’s id. The name attribute on the
    <input> tag is the name that is used to identify the data. The for, name, and id attributes are often
    the same, but only the for and the id need to match.

    for属性链接到input的id,不会name属性链接

    看这段代码很清楚:

    <fieldset>
    <legend>what is your gender? </legend>
    <input type="radio" id="genderf" name="gender" value="f" checked="checked"/>
    <label for="genderf">Female</label>
    <input type="radio" id="genderm" name="gender" value="m"/>
    <label for="genderm">Male</label>
    </fieldset>
    The name attribute matches for each of the radio buttons name相同,
    This groups the radio buttons together so only one value is sent for the group. The value attribute is the value that is submitted, not what is inthe label. Because you cannot have duplicate id attributes, this is one place where your for and id

    attributes do not match your name attribute.


        The <input> tag of type=”submit” is the Submit button. When the user clicks that button, the form

    is submitted for processing. This is often used to identify the form. The data is named by the name
    attribute and the value is from the value attribute, which is also what is displayed on the button.

         Use the <input> tag to create the submit buttons in forms. <input  type=”submit”> automatically submits the form. <input type=”button”> does  not automatically submit the form. You need to use JavaScript to submit it.
    If you use the <button> tag instead of the <input> tag, be aware that Internet Explorer passes the information between the button tags and all the other   browsers use the value.



  • 相关阅读:
    [纯C#实现]基于BP神经网络的中文手写识别算法
    【转载】Jedis对管道、事务以及Watch的操作详细解析
    redis 缓存用户账单策略
    redis 通配符 批量删除key
    explain分析sql效率
    mysql 常用命令大全
    【转载】实战mysql分区(PARTITION)
    mysql表名忽略大小写配置
    【转】微服务架构的分布式事务解决方案
    【转载】Mysql中的Btree与Hash索引比较
  • 原文地址:https://www.cnblogs.com/youxin/p/2329412.html
Copyright © 2011-2022 走看看