zoukankan      html  css  js  c++  java
  • jquery选择器之表单选择表单对象属性

      :input 匹配所有input标签

      :text 匹配所有单行文本框

      :password 匹配所有密码框

      :radio  匹配所有单选扭

      :checkbox 匹配所有复选框

      :image 匹配所有图像域

      :reset 匹配所有重置按扭

      :button 匹配所有按扭

      :file 匹配所有文件域

      示例代码

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <form>
        <input type="button" value="Input Button"/>
        <input type="checkbox" />
    
        <input type="file" />
        <input type="hidden" />
        <input type="image" />
    
        <input type="password" />
        <input type="radio" />
        <input type="reset" />
    
        <input type="submit" />
        <input type="text" value="text" />
        <select><option>Option</option></select>
    
        <textarea></textarea>
        <button>Button</button>
    </form>
    
        <script src="jquery-3.1.0.js"></script>
        <script type="text/javascript">
    //        匹配所有input标签
            $(":input")
    //        匹配所有input标签中类型为text的元素
            $(":text")
    //        匹配所有input标签中类型为password的元素
            $(":password")
            匹配所有input标签中类型为radio的元素
            $(":radio")
            $(":checkbox")
            $(":submit")
            $(":image")
            $(":reset")
            $(":button")
            $(":file")
    //        匹配所有input,select标签中可用的元素
    $(":enabled")
    // 匹配所有input,select标签中不可用的元素
    $(":disabled")
    $(":checkbox")
    $(":selected")
     </script> </body> </html>

      

  • 相关阅读:
    linux 程序安装目录/opt目录和/usr/local目录的区别
    Linux文件目录结构详解
    Jenkins卸载方法(Windows/Linux/MacOS)
    Jmeter案例demo
    idea打包java可执行jar包
    查看端口状态
    轻松掌握mongodb
    sphinx和coreseek
    redis
    redis默认端口6379以其名命名,是我孤陋寡闻了,是名性感美女(梅尔兹)
  • 原文地址:https://www.cnblogs.com/kongzhagen/p/6193947.html
Copyright © 2011-2022 走看看