I am creating an "mousedown" event on an element and toggling a variable if shift key is pressed down. I also want to make the variable false when the "mouseup" event occurs.
element.addEventListener("mousedown", (e)=>{
if(e.shiftKey){
this.start = true;
} else {
this.start = false;
}
});
I want to make the this.start to false when the mouseup occurs subsequently after the above code. Could anyone help me out with it.
Thank you.