'this' reference variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vicksa
    New Member
    • Jul 2007
    • 1

    'this' reference variable

    when to use this,this.value , this.property name and whats the definition and meaning of 'this' ?
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    in short: it is always the actual context of the current object where you want to execute a method or ask for a property ... so you have to know for yourself what 'this' is in the particular case ... when you use 'this' without using custom js-objects in most cases it refers the current window/frame ... but you may also pass 'this' with an eventhandler like onclick to a function and then 'this' is the current object where the event occured ...

    for more explaination have a look here

    kind regards ...

    Comment

    Working...