Hello everyone!
I am trying to copy AttachEvents but i don't know how.
Because innerHTML doesn't copy the AttachEvents.
Here is an example:
<script>
function a(){
alert("is changing");
}
</script>
<div id="d1" name="d1">
<select id="s1" name="s1">
<option>A</option>
<option>B</option>
</select>
</div>
<script>
s1.attachEvent( "onchange", a);
</script>
<div id="d2" name="d2">
</div>
<script>
d2.innerHTML=d1 .innerHTML;
</script>
Can anyone help me?
I am trying to copy AttachEvents but i don't know how.
Because innerHTML doesn't copy the AttachEvents.
Here is an example:
<script>
function a(){
alert("is changing");
}
</script>
<div id="d1" name="d1">
<select id="s1" name="s1">
<option>A</option>
<option>B</option>
</select>
</div>
<script>
s1.attachEvent( "onchange", a);
</script>
<div id="d2" name="d2">
</div>
<script>
d2.innerHTML=d1 .innerHTML;
</script>
Can anyone help me?
Comment