I create user input in one of the events:
var throwConnectBox = function() { chat_box = document.getElementById('box'); div = window.parent.document.createElement('div'); input = window.parent.document.createElement('input'); input.type = "submit"; input.value = "Join chat"; input.onclick = "conn.send('$connect\r\n');"; div.appendChild(input); chat_box.appendChild(div); }
... but the result does not have the onclick property. I tried to use
input.onclick = conn.send('$connect\r\n');
... instead, but did not work. What am I doing wrong?
javascript input onclick
Alex Apr 25 '09 at 10:15 2009-04-25 22:15
source share