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.