Tambahkan Kutipan Tunggal di String JavaScript InnerHTML
document.getElementById("img").innerHTML = '<img src="/sitepath/' + imgg + '.jpg" width="72" height="44" onclick="alert(\'hello\');" />';
Calm Cod