So here’s my code:
<input type = checkbox id = "kinch" name = "link" > Bunz </input>
<div id = bootypipe></div>
Here’s the JavaScript:
$("#kinch").click(function(){
if ($("#kinch").is(":checked")) {
//Add image to div bootypipe
$("#bootypipe").append("<image id = 'chink' src = 'http://4.bp.blogspot.com/_TUdhYRa2Xm0/RsuDa4NvSEI/AAAAAAAAAQs/jr_r6v_SUgs/s320/New-England-Style-Hot-Dog-Buns_8A827671.jpg'>HA!</image>");
} else {
$("#chink").remove();
}
});
Here’s the jsfiddle: http://jsfiddle.net/shrimpboyho/wUu34/13/
The image removes and appends, but when I remove the image the text Ha! still stays and builds up over time. How can I remove this?
Cant you just do :
instead of removing image.