At first thought this and $ (this) is a die carved out. But when I read, and coding, it's not the same thing.
Here this is actually an HTML element (textbox), TextBox has the Text property, so it is absolutely no problem to write.
$ ("#textbox"). Hover ( function() { this. title = "Test"; }, fucntion () { this. title = "OK"; } );
But if you change this to $ (this) it is not the case, error--reported.
Error Code: $ ("#textbox"). Hover ( function() { $ (this). title = "Test"; }, function() { $ (this). title = "OK"; } );
View Code
The $ (this) here is a jquery object, and the jquery object does not have the title property, so it is wrong to write this.
jquery has the attr () method to get/set the properties of Dom objects, so the correct wording should be:
the correct code: $ ("#textbox"). Hover ( function() { $ (this). attr (' title ', ' Test '); }, function() { $ (this). attr (' Title ', ' OK '); } );
View Code
This and $ (this)