How to turn 'this' into a jquery object?
How do you turn 'this' into a jQuery object so that you can invoke jQuery methods on it?
For example I have this code currently:
-
<tr onmouseover="this.className='highlight';" onmouseout="this.className='';">
But I would like to use jQuery's addClass and removeClass function. So Ive tried things like:
-
this.addClass('highlight');
,which doesnt work I assume because this is not yet a jQuery wrapped-object
and
-
$('this').addClass('highlight');
, which doesnt work because I guess its like calling document.getElementById('this') which is crazy.
So how do you do it? thanks![/code]