Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Changes
Page history
Update JQuery
authored
Apr 27, 2022
by
Joel H
Hide whitespace changes
Inline
Side-by-side
Web/Javascript/JQuery.md
View page @
1d021f88
...
...
@@ -61,12 +61,12 @@ $('.solid').addClass('highlight'); //add the class highlight to every object wit
```
javascript
//Events
$
(.
box
'
).on(
'
click
'
, function(){ //equivalent of AddEventListener()
$
(
'
.box
'
).
on
(
'
click
'
,
function
(){
//equivalent of AddEventListener()
console
.
log
(
"
Hello
"
);
$
(
this
);
//refers to the .box
});
$(.box
'
).
on
(
'
click
'
,
'
.box-button
'
,
function
(){
//equivalent of AddEventListener()
$
(
'
.box
'
).
on
(
'
click
'
,
'
.box-button
'
,
function
(){
//equivalent of AddEventListener()
console
.
log
(
"
Hello
"
);
$
(
this
);
//with 3 parameters, the 2nd parameter delegate the $(this) to the new said element
});
...
...
...
...