What I'm making
I just learned JQuery and i'm exercising by trying to make a webapp version of Window's Sticky Notes
What I'm trying to do
I have a close-button on the right side, of a top navbar-like div, for each sticky div. I'm trying to make it so that when you click this div, the whole sticky div deletes.
My problem
No response upon clicking the div
My Code
Entire project: https://codepen.io/kymed/pen/ajdmwY
Relevant code:
let closebtnimg = "<img src='x.png' style='float:right;'></img>";
$(closebtnimg).appendTo(this.topdiv);
$(closebtnimg).mousedown(function(){
$(me.div).remove();
})
What I've tried
I tried creating a div and using the image as a background image, then I tried again while setting the div's opacity to 0 and background color to white.
I also tried this, a chunk of code from a similar post where I replaced "load" with "click"
$("img").one("load", function() {
// do stuff
}).each(function() {
if(this.complete) $(this).load();
});