jquery replaceWith for special html character -
on page have star using:
<div class="favorite">☆ </div>
on hover, want replace filled in star. here's jquery code wrote:
$(".favorite").hover( function(){ $(this).replacewith("★"); }, function(){ } );
however, never seems work. way shows me text. removing quotes, breaks. suggestions help! understand png i'd rather not --- 1 less thing need have. thank you!
use html() in jquery:
$(".favorite").hover( function(){ $(this).html("★"); }, function(){ $(this).html("☆"); } );
Comments
Post a Comment