JavaScript Tutorial/Object Oriented/this

Материал из Web эксперт
Перейти к: навигация, поиск

The this Keyword

The this keyword points to the object that is calling a particular method.



   <source lang="javascript">

var myHourse = new Object; myHourse.color = "red"; myHourse.showColor = function () {

   alert(this.color);

};</source>