What is the fundamental difference between using $(this) vs this
$('.viewComments').click(function(ev){
//returns the desired value
alert(this.getAttribute('id'));
//Gives an error sayin function is not defined
alert($(this).getAttribute('id'));
//returns the desired value
alert($(this).attr('id'));
});
What i thought was "$(this)" will contain all functions that "this" has and more..But that doesn't seem to be the case.
So what exactly is $(this)? and
Hw do i knw what functions are avaliable when im using it? (i knw i can get them through firebug. but i would like to know if there any some other way- some doc may be)