$()
$()
, It’s jquery selectors.
The selector allows you to manipulate groups of HTML elements or individual elements.
In HTML DOM terminology:
The selector allows you to operate on a DOM element group or a single DOM node.
this
What is “this”?
In many object-oriented programming languages, this (or self) is a keyword which can be used in instance methods to refer to the object on which the currently executing method has been invoked.
In JS, this refers to an element of html. It has various attributes, but these attributes are not all displayed in html.
$(this)
As we know, this and selector. what is “$(this)” ?
(
t
h
i
s
)
,
I
t
i
s
a
s
e
l
e
c
t
o
r
f
o
r
s
e
l
e
c
t
i
n
g
t
h
e
c
u
r
r
e
n
t
e
l
e
m
e
n
t
.
S
o
w
e
c
a
n
m
a
n
i
p
u
l
a
t
e
i
t
s
p
r
o
p
e
r
t
i
e
s
b
y
"
(this), It is a selector for selecting the current element. So we can manipulate its properties by "
(this),Itisaselectorforselectingthecurrentelement.Sowecanmanipulateitspropertiesby"(this).xxx".
Reference
http://www.w3school.com.cn/jquery/jquery_ref_selectors.asp
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this