+ 1
What is the main function of the this keyword
javascript
2 Answers
+ 1
'this' keyword?
It refers to the current object. For example, see this JQuery code:
$("#potato"). click(function (){
$("potato").css('color','red');
//you can also write this line as
this.css('color','red');
});
- 1
What keyword?