/*************** javascript *****************/
function here(getValue) {
alert(getValue)
}
function aaa() {
document.getElementById('asd').innerHTML = '<input type="text" name="textfield" onkeyup="here(this.value)" />'
}
function aaa2() {
var temp = document.getElementById('asd').innerHTML
document.getElementById('asd').innerHTML = temp+'<input type="text" name="textfield" onkeyup="here(this.value)" />'
}
function dom() {
var zzz = document.getElementById('asd')
var inp = document.createElement('input')
inp.type = 'text'
inp.name = 'textfield'
inp.onkeyup = function() {here(this.value)}
zzz.appendChild(inp)
}
/************************************/
<div id="asd">
<input type="text" name="textfield" onkeyup="here(this.value)" />
</div>
<input type="button" name="Button1" value="Button1" onclick="aaa2()" />
<input type="button" name="Button2" value="Button2" onclick="dom()" />
need some help...
i create a textfield using dom by click Button1, then combine with textfield using innerhtml by click button2.
the problem is after combine the dom createelement with innerhtml, the textfield created by dom cannot call the javascript function...
anyone have a solution...
thanks...