zoukankan      html  css  js  c++  java
  • 什么也不会系列之HTML

    <!DOCTYPE html>
    <html>
    <body>
    
    <form action="/demo/demo_form.asp">
    First name:<br>
    <input type="text" name="firstname" value="Mickey">
    <br>
    Last name:<br>
    <input type="text" name="lastname" value="Mouse">
    <br><br>
    <input type="submit" value="Submit">
    </form> 
    
    <p>如果您点击提交,表单数据会被发送到名为 demo_form.asp 的页面。</p>
    
    </body>
    </html>
    <!--表单-->

    列表框

    <!DOCTYPE html>
    <html>
    <body>
    
    <select>
      <option>Volvo</option>
      <option>Saab</option>
      <option>Mercedes</option>
      <option>Audi</option>
    </select>
     
    </body>
    </html>

    向上移,

    
    
    <html>
    <head>
    <script type="text/javascript">
    function setFocus()
      {
      document.getElementById('text1').focus()
      }
    function loseFocus()
      {
      document.getElementById('text1').blur()
      }
    </script>
    </head>
    <body>
    
    <form>
    <input type="text" id="text1" />
    <br />
    <input type="button" onclick="setFocus()" value="Set focus" />
    <input type="button" onclick="loseFocus()" value="Lose focus" />
    </form>
    
    </body>
    </html>
    
    
    
    

    按钮

    <html>
    <body>
    
    <button type="button">Click Me!</button>
    
    </body>
    </html>

    提交

    <html>
    <head>
    <script type="text/javascript">
    function formSubmit()
    {
    document.getElementById("myForm").submit()
    }
    </script>
    </head>
    
    <body>
    <p>在下面的文本框中输入一些文本,然后点击提交按钮就可以提交表单。</p>
    
    <form id="myForm" action="/i/eg_smile.gif" method="get">
    名:<input type="text" name="firstname" size="20"><br />
    姓:<input type="text" name="lastname" size="20"><br />
    <br />
    <input type="button" onclick="formSubmit()" value="提交">
    </form>
    </body>
    
    </html>

    单选选择

    <html>
    <body>
    
    <p>请点击文本标记之一,就可以触发相关控件:</p>
    
    <form>
    <label for="male">Male</label>
    <input type="radio" name="sex" id="male" />
    <br />
    <label for="female">Female</label>
    <input type="radio" name="sex" id="female" />
    </form>
    
    </body>
    </html>

      多行文本域

    <textarea name="textarea" cols="显示的列数" rows="显示的行数">
    文本内容
    </textarea>

      文件域

    <form action="" method="post" enctype="multipart/form-data">
        <p>
          <input type="file" name="files"/><br/>
          <input type="submit" name="upload" value="上传“/>
        </p>
    </form>
    <!--在不同的浏览器显示的效果不一样-->

    URL地址格式

    <form action=""method="post">
        <p>
            输入你的网址:
        <input type="url" name="userUrl"/>
       </p>
    <input type="submit"/>
    </form>    

    number数字

    <form action="#“ method="post">
        <p>
            请输入数字:
            <input type="number" name="um" min="0" max="最大值" step="最小值”/>
        </p>
        <input type="submit"/>
    </form>
  • 相关阅读:
    RedHat7安装NetCore环境并发布网站
    【WPF学习】第四十二章 透明
    细说枚举
    js获取ip地址,操作系统,浏览器版本等信息,可兼容
    js实现数据流(日志流,报警信息等)滚动展示,并分页(含实现demo)
    js实现点击copy,可兼容
    js实现htmlToWordDemo
    H5 web 存储之 Webstorage
    已发布的WEB项目,如何挂在服务器或者本机的IIS下
    Nuget打包没有注释显示
  • 原文地址:https://www.cnblogs.com/n6666/p/7446321.html
Copyright © 2011-2022 走看看