Detailed example of jQuery form object attribute filter selector
This article mainly brings you an example of the jQuery selector's form object attribute filtering selector. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor to take a look, I hope it can help everyone.
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title></title> <link rel="stylesheet" href="imooc.css" rel="external nofollow" type="text/css"> <style> input { display: block; margin: 10px; padding: 10px; } </style> <script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script> </head> <body> <h2>子元素筛选选择器</h2> <h3>enabled、disabled</h3> <form> <input type="text" value="未设置disabled" /> <input type="text" value="设置disabled" disabled /> <input type="text" value="未设置disabled" /> </form> <script type="text/javascript"> //查找所有input所有可用的(未被禁用的元素)input元素。 $("input:enabled").css("border", "2px groove red"); </script> <script type="text/javascript"> //查找所有input所有不可用的(被禁用的元素)input元素。 $("input:disabled").css("border", "2px groove blue"); </script> <h3>checked、selected</h3> <form> <input type="checkbox" checked="checked"> <input type="checkbox"> <input type="radio" checked> <input type="radio"> <select name="garden" multiple="multiple"> <option>imooc</option> <option selected="selected">慕课网</option> <option>aaron</option> <option selected="selected">博客园</option> </select> </form> <script type="text/javascript"> //查找所有input所有勾选的元素(单选框,复选框) //移除input的checked属性 $("input:checked").removeAttr('checked') </script> <script type="text/javascript"> //查找所有option元素中,有selected属性被选中的选项 //移除option的selected属性 $("option:selected").removeAttr('selected') </script> </body> </html>
Note:
In some browsers, the selector:checked may be incorrect The
Related recommendations:
Detailed explanation of jquery selector practice
Detailed explanation of jQuery form element selector
Example sharing JQuery selector and DOM node operation practice
The above is the detailed content of Detailed example of jQuery form object attribute filter selector. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to use PUT request method in jQuery? In jQuery, the method of sending a PUT request is similar to sending other types of requests, but you need to pay attention to some details and parameter settings. PUT requests are typically used to update resources, such as updating data in a database or updating files on the server. The following is a specific code example using the PUT request method in jQuery. First, make sure you include the jQuery library file, then you can send a PUT request via: $.ajax({u

Here's how to convert a MySQL query result array into an object: Create an empty object array. Loop through the resulting array and create a new object for each row. Use a foreach loop to assign the key-value pairs of each row to the corresponding properties of the new object. Adds a new object to the object array. Close the database connection.

Title: jQuery Tips: Quickly modify the text of all a tags on the page In web development, we often need to modify and operate elements on the page. When using jQuery, sometimes you need to modify the text content of all a tags in the page at once, which can save time and energy. The following will introduce how to use jQuery to quickly modify the text of all a tags on the page, and give specific code examples. First, we need to introduce the jQuery library file and ensure that the following code is introduced into the page: <

Title: Use jQuery to modify the text content of all a tags. jQuery is a popular JavaScript library that is widely used to handle DOM operations. In web development, we often encounter the need to modify the text content of the link tag (a tag) on the page. This article will explain how to use jQuery to achieve this goal, and provide specific code examples. First, we need to introduce the jQuery library into the page. Add the following code in the HTML file:

PHP functions can encapsulate data into a custom structure by returning an object using a return statement followed by an object instance. Syntax: functionget_object():object{}. This allows creating objects with custom properties and methods and processing data in the form of objects.

Forms are an integral part of writing a website or application. Laravel, as a popular PHP framework, provides rich and powerful form classes, making form processing easier and more efficient. This article will introduce some tips on using Laravel form classes to help you improve development efficiency. The following explains in detail through specific code examples. Creating a form To create a form in Laravel, you first need to write the corresponding HTML form in the view. When working with forms, you can use Laravel

In C++, there are three points to note when a function returns an object: The life cycle of the object is managed by the caller to prevent memory leaks. Avoid dangling pointers and ensure the object remains valid after the function returns by dynamically allocating memory or returning the object itself. The compiler may optimize copy generation of the returned object to improve performance, but if the object is passed by value semantics, no copy generation is required.

In PHP, an array is an ordered sequence, and elements are accessed by index; an object is an entity with properties and methods, created through the new keyword. Array access is via index, object access is via properties/methods. Array values are passed and object references are passed.
