Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery hover - mouseout event not working in IE8
    primarykey
    data
    text
    <p>I have two boxes on my screen, both with dynamically generated text. The first is a mad-libs type of paragraph where you can click on words on the bottom half of the screen and have them replace words in the top box. (They're linked by the 'data-id' attribute in the code here.) What I want is for the words in the bottom box to be underlined when I hover over them and the corresponding word in the top box to be bolded. The mouseenter handler for hover works just fine in all my browsers. But the mouseleave handler seems to be ignored in IE8, because words stay bolded and underlined in IE8.</p> <pre><code>&lt;script&gt; $(document).ready(function() { function hoverIn () { var id = $(this).attr('data-id'); var txt = $('.fullText span[data-id='+id+']').text(); var vartxt = $(this).text(); $('.fullText span[data-id='+id+']').html('&lt;b&gt;'+txt+'&lt;/b&gt;'); $(this).html('&lt;u&gt;'+vartxt+'&lt;/u&gt;'); } function hoverOut () { var id = $(this).attr('data-id'); var txt = $('.fullText span[data-id='+id+']').html(); var newtxt1 = txt.replace(/&lt;b&gt;/gm, ''); var newtxt = newtxt1.replace(/&lt;\/b&gt;/gm, ''); var vtxt = $(this).html(); var newvtxt1 = vtxt.replace(/&lt;u&gt;/gm, ''); var newvtxt = newvtxt1.replace(/&lt;\/u&gt;/gm, ''); $('.fullText span[data-id='+id+']').html(newtxt); $(this).html(newvtxt); } $('body').load( function(){ $('#analyzed').addClass('analyzed'); }); $(".confWords span").bind('click', (function () { var id = $(this).attr('data-id'); $('.fullText span[data-id='+id+']').text($(this).text()); })); $(".confWords span").hover( hoverIn, hoverOut ); // Disregard the next $("#reset").bind('click', (function() { $('.orig').trigger('click'); })); $("#edit").bind('click', (function() { history.back(-1); })); }); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload