How to remove append image using jquery
<pre><code>a(document).on("click.frTTS", "#fr_screenreader_play,#allmode-id126,.allmode-text,.allmode-topitem,.itemFullText,#k2Container" ,function(b) {
    var abc = $(this).attr('id');
    alert($(this).attr('class'));
    if(abc == "fr_screenreader_play")
    {     $('&lt;img src="http://www.test.com/arc/eng/images/speaker32.png"&gt;').remove();
    }    else
    {
        $(this).append('&lt;img src="http://www.test.com/arc/eng/images/speaker32.png"&gt;');
    }
    c = true;
    d = "play";
    clearTimeout(e);
    f = w();
    if (!f.length) z("notext"); else {
        t();
        if ("proxy_responsive" == l.readerEngine) responsiveVoice.speak(f, j, {
            volume: l.screenReaderVolume / 100,
            onend: function() {
                z("finished");
                alert("finished");
                $('&lt;img src="http://www.test.com/arc/eng/images/speaker32.png"&gt;').remove();
            }
        }); else q();
        z("playing");
    }
    a("#fr_screenreader_pause").removeClass("active");
    b.stopPropagation();
    b.preventDefault();
});
</code></pre>

<p>I want to remove the image after loop finishes. After getting alert closed. Please help me to fix this issue. I am trying to fix this issue from morning. It is my first Javascript modification.</p>