This and $ (this) objects, this objects

Source: Internet
Author: User

This and $ (this) objects, this objects

This and $ (this) objects.
The former is a Javascript Object, while the latter is jQuery.
They can only use their own methods. Javascript objects use Javascript methods, while jQuery objects use jQuery methods. If the Javascrip object uses the jQuery method, and the jQuery object uses the Javascript method, errors will naturally occur.

 

Objects can be converted.
For example, we want to obtain the following Input text value:

<Input id = "Text1" type = "text" value = "Insus. NET"/>


A value Attribute of Javascript:


JQuery has a val () method:

 

OK. After the demonstration, we will demonstrate the intercommunication and interchange of an object:
First, convert Javascript objects to jQuery objects:


The following shows how to convert a jQuery object to a Javascript Object:
 

 

Above, no matter which method, the webpage alert will be used to output the input text value.

 

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.