$()
$() , 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
博客主要介绍了jQuery中的$()、this和$(this)。$()是jQuery选择器,可操作HTML元素组或单个元素;this在JS里指HTML元素;$(this)是选择当前元素的选择器,可通过$(this).xxx操作其属性,还给出了相关参考链接。

945

被折叠的 条评论
为什么被折叠?



