zoukankan      html  css  js  c++  java
  • 表单事件

     1 <!DOCTYPE html>
     2 <html lang="en">
     3 <head>
     4     <meta charset="UTF-8">
     5     <title>表单事件</title>
     6 </head>
     7 <body>
     8     <form action="">
     9         <input type="text" name="usr">
    10         <button type="submit">提交</button>
    11         <div></div>
    12     </form>
    13 </body>
    14 <script type="text/javascript">
    15     var form = document.querySelector('form')
    16     var ipt = document.querySelector('input')
    17     var btn = document.querySelector('button')
    18     ipt.onselect = function () {
    19         console.log('文本被选中');
    20     };
    21     var div = document.querySelector('div')
    22     // ipt.oninput = function () {
    23     //     console.log('值改变');
    24     //     div.innerText = this.value
    25     // };
    26     // ipt.onkeyup = function () {
    27     //     div.innerText = this.value
    28     // }
    29     // ipt.onchange = function () {
    30     //     div.innerText = this.value
    31     // }
    32     form.onsubmit = function () {
    33         console.log('提交')
    34         return false;
    35     }
    36 
    37 </script>
    38 </html>
  • 相关阅读:
    Asp:Cookies应用指南
    asp:cookies的属性
    数据库压缩
    asp之servervariables全部显示
    sql语句操作表
    asp之FSO大全
    SQL语句
    vbscript语句
    asp之vbscript函数
    IDEA 2017web项目的创建
  • 原文地址:https://www.cnblogs.com/xuqidong/p/12113299.html
Copyright © 2011-2022 走看看