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>
  • 相关阅读:
    UIPath RPA 自动化脚本 机器人从入门到精通
    [转]面向物联网的21个开源软件项目
    数字化转型
    区块链项目大全-项目源码链接收藏
    SAP HANA学习资料大全 Simple Finane + Simple Logisitic [非常完善的学习资料汇总]
    今日头条技术架构分析
    巴菲特价值投资的六项法则
    文档大师 2016 :在电脑和头脑中快速找到文档的文件管理软件
    文档大师 在Win10 IE11下,文档集画面无法正常显示Word等Office文档的解决方法
    人脑+电脑:通过文档管理让个人能力大大拓展
  • 原文地址:https://www.cnblogs.com/n6666/p/7446321.html
Copyright © 2011-2022 走看看