i try to use jquery’s on()-Method in combination with hover(). I want that the user hovers over a div, gets a value displayed and when moving his mouse away from that div see the old value again, but this is not working… Does anybody have a clue?
$('#content').on('hover', '.player_marktwert_box',
function() {
var playerValue = $(this).html();
$(this).html("test");
},
function () {
$(this).html(playerValue);
}
);
Thanks!
Please check out this question for more details. Since playerValue is outside of the scope of the event it will have a value that persists. Depending on your scripting this could work, depending on whether it is possible to mouse over multiple
.selectorelements at once.