html() not updating until I scroll the page

html() not updating until I scroll the page

I have a custom font, and a class that I put on a div that replaces any text in the div with the custom font icon...

This div is supposed to switch between a search icon and an x icon. Sometimes, the icon doesn't change until I nudge the page up or down... can't figure out why? 

Here's the div:
  1. <a href="/search/" class="ficon" id="search-trigger">B</a>

and here's the jquery:
  1. jQuery(document).ready(function(){
  2. jQuery("#search-trigger").click(function(e){
  3. if(jQuery("#search-trigger").html() == "B"){
  4. jQuery("#search-trigger").html("G");
  5. }
  6. else{
  7. jQuery("#search-trigger").html("B");
  8. }
  9. jQuery("#search-wrapper").toggle();
  10. e.preventDefault();
  11. });
  12. });