zoukankan      html  css  js  c++  java
  • 表单

    form标签中必须指定一个action属性,该属性指向的是一个服务器的地址
              当我们提交表单时,将会提交到action 属性对应的地址
                在html中还为我们提供可一个标签,专门用来选中表单中的提示文字的 label 标签
                该标签可以指定一个  for  属性,该属性的值需要指定一个表单项的 id 值
              <form action=" index.html " >  // 没有服务器地址可以先提交到另外一个页面,通过网址查看提交的内容
                <label for='um'>用户名:</label><input type='text'   name='username'   id=' um '   />
                <label for='pwd'>密码:<label><input type='password'    name='password' id=' pwd '  />
                单选框:<input  type='radio'  name='gender'  value='man'  id='man' /><label for='man'>男</label>
                    <input  type='radio'  name='gender'  value='woman' id='woman' /><label for='woman'>女</label>
                <!--
                  使用select 来创建一个下拉列表,下拉列表的 name 属性需要指定给select,而 value属性需要制定给option
                  可以通过在 option 中添加selected=‘selected’ 来将选项设置为默认选中
                    在select 中可以使用 optgroup 对选项进行分组,同一个 optgroup 中的选项是一组
                    可以通过 label 属性指定分组的名字
                -->
                <!--
                  在表单中可以使用fieldset 来为表单项进行分组,可以将表单项中的同一组放到一个 fieldset 中
                  在 fieldset 可以使用 legend 子标签,来指定组名
                -->
                <fieldset>
                  <legend>喜欢的明星</legend>
                  <select  name=' star '>
                    <optgroup  label='女明星'>
                      <option  value='fbb'>范冰冰</option>
                      <option  value='lxr'>林心如</option
                    </optgroup>
                    <optgroup  label='男明星'>
                      <option  value='ldh'>刘德华</option>
                      <option  value='zjl'>周杰伦</option>
                    </optgroup>
                  </select>
                </fieldset>
                <input  type='submit'  value='注册'  />
                <input  type='reset'   value='重置' />
              </form>
    

      

  • 相关阅读:
    【基础算法】- 全排列
    【基础算法】- 2分查找
    区块链培训
    Static Binding (Early Binding) vs Dynamic Binding (Late Binding)
    test
    No data is deployed on the contract address!
    "throw" is deprecated in favour of "revert()", "require()" and "assert()".
    Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning.
    京都行
    Failed to write genesis block: database already contains an incompatible
  • 原文地址:https://www.cnblogs.com/qtbb/p/11381113.html
Copyright © 2011-2022 走看看