how can I add a class when mouse is over an element?
var row = $('<tr></tr>')
.append('<td class="list_row">'+js2txt(string)+'</td>')
.mouseover(function(){
this.addClass('list_row_mover');
});
js error:
this.addClass is not a function
In your function the scope (
this) is the HTML element, not the jQuery object.Here is a possible fix: