I am using the prepend() function to diplay an image when a div is hoevered over. How do I remove the image - i.e. what is the opposite of prepend()
Here is the code:
$("#hover-div").hover(
function() { $("#image-div").prepend("<img src='images/arrow_redo.png' width='16' height='16' />"); },
function() { $("#image-div").someFunction("<img src='images/arrow_redo.png' width='16' height='16' />"); }
);
someFunction is just a dummy - I am not really expecting it to do anything.
If you have the id for the image element you can simply use the remove method.
$("#imgID").remove();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With