I am trying to create one image using JavaScript; then later in the script
remove the image - not just remove the src.
The following creates the image, but I have been unable to remove it.
How do I structure
document.getEle mentById('num1' ).removeChild(i mage_display); ?
<input type=file name="picture1" onChange="image (this.value, 'num1');"
Id="pt1">
<div id='num1'></div>
<script type="text/javascript">
function image_size(fiel d, num){
image_display=d ocument.createE lement('img');
image_display.s rc=field;
document.getEle mentById('num1' ).appendChild(i mage_display);
..
..
..
document.getEle mentById('num1' ).removeChild(i mage_display);
}
</script>
Thanks for help.
Ken
remove the image - not just remove the src.
The following creates the image, but I have been unable to remove it.
How do I structure
document.getEle mentById('num1' ).removeChild(i mage_display); ?
<input type=file name="picture1" onChange="image (this.value, 'num1');"
Id="pt1">
<div id='num1'></div>
<script type="text/javascript">
function image_size(fiel d, num){
image_display=d ocument.createE lement('img');
image_display.s rc=field;
document.getEle mentById('num1' ).appendChild(i mage_display);
..
..
..
document.getEle mentById('num1' ).removeChild(i mage_display);
}
</script>
Thanks for help.
Ken
Comment