jquery replaceWith for special html character -


on page have star using:

    <div class="favorite">&#9734 </div> 

on hover, want replace filled in star. here's jquery code wrote:

    $(".favorite").hover(         function(){             $(this).replacewith("&#9733;");         },         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("&#9733;");         },         function(){              $(this).html("&#9734;");         }     ); 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -