Dynamically change image src using Jquery not working in IE and firefox
<p>I am implementing a captcha for a email. when click on <code>linkEmail</code> button email modal will open.
there i have to set captcha image generated by a handler (CaptchaGenerator.ashx) on click of <code>linkEmail</code> button click. Here is the code for that.</p>

<pre><code>$(".linkEmail").click(function () {
  //Load captcha image
  $('.imgCaptcha').attr('src', '/Custom/AppCode/Utilities/CaptchaGenerator.ashx');
  $('#emailModal').modal();
});
</code></pre>

<p>Above code is working fine in crome but <strong>not working</strong> in IE and firefox.
Although i have tried followings there is no luck.</p>

<p>HTML:</p>

<pre><code>&lt;p id="captchacontainerp" class="captchacontainer"&gt;&lt;/p&gt;
-------------------------------------------------------------
$('#captchacontainerp').prepend($("&lt;img id='imCaptcha' class='imgCaptcha' src='/Custom/AppCode/Utilities/CaptchaGenerator.ashx'&gt;&lt;/img&gt;"));
-------------------------------------------------------------
var img = $('&lt;img id="imCaptcha" class="imgCaptcha"&gt;');
img.attr('src', '/Custom/AppCode/Utilities/CaptchaGenerator.ashx');
$('#captchacontainerp').empty();
img.appendTo('#captchacontainerp');
---------------------------------------------------------------
$('#captchacontainerp').empty();
$('#captchacontainerp').append($("&lt;img id='imCaptcha' class='imgCaptcha' src='/Custom/AppCode/Utilities/CaptchaGenerator.ashx'&gt;&lt;/img&gt;"));
</code></pre>
