Dynamically change the HTML <img> src attribute using Java Script or JQuery
<p>I need to change the html img src value dynamically from the value from hidden text field using Jquery or Java script.</p>

<pre><code>&lt;p&gt;&lt;img id="yui_img" height="333" width="345"&gt;&lt;/p&gt;

function onImgChange()
 {
document.getElementById('yui_img').src=document.getElementById('addProductLinksCreateForm:addProductLinkUrlValue').value;

 }
</code></pre>

<p>I got the value in the DOM but it is not getting reflected in it. Old image is maintained. </p>
