jquery--Form Object Properties Filter selectors and special selectors this

Source: Internet
Author: User

Form Object Properties filter selectors and special selectors this

1 The Form object property Selector is designed for form elements and can be appended to other selectors to filter the selected form elements

2 Description of the Form object property Selector

$ (": Enabled") Pick available form elements

$ (":d isabled") Select an unavailable form element

$ (": Checked") Select the selected <input> element

$ (": Selected") Select the selected <option> element

3 selectors apply to check boxes and radio boxes, drop-down box elements use the selected selector

4 input:checked Selector Selects only <input> elements in any browser

5 The difference between this and $ (this)

This is a keyword in JavaScript that indicates that the current context object is an HTML object that can invoke properties and methods owned by an HTML object

$ (this) means that the context object is a jquery context object that can invoke the methods and property values of jquery

6 in JavaScript This is dynamic, meaning that the context object can be changed dynamically by means of call and apply.

7 This is a reference to the DOM element itself, in the DOM this is a pointer to this HTML element object

8 in the AddEventListener binding event, this points to the current DOM object, which can be obtained through this when it is modified again, but it is more complex, and it is much easier to make this a jquery object

9 getting to the referenced method through this

such as P.addeventlistener (' click ', Function () {

This===p

Both of the following modifications are equivalent

This.style.color= "Red";

P.style.color= "Red";

},false);

How to process this as a jquery

such as $ (' P '). Click (function () {

Convert p elements into jquery objects

var $this =$ (This)

$this. CSS (' Color ', ' red ')

})

jquery--Form Object Properties Filter selectors and special selectors this

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.