Koristim ovu funkciju za stavljanje smiley-a u textbox:
function writeImgTag(code) {
this.code = code;
document.txtPoruka.value = "<img src='../smileys/" + code + ".gif'>";
document.txtPoruka.focus();
}
Ovdje pozivam funkciju :
<img alt = "" onclick="writeImgTag('hahaha')" src="../smileys/hahaha.gif" border="0" height="22" width="22" />
Međutim. dobivam error poruku:
document.txtPoruka is null or not an object
Zašto?