Как не учитывать событие click?
var floatingBadge = document.createElement("div"); floatingBadge.style.position = "absolute"; floatingBadge.style.top = "100px"; floatingBadge.style.left = "100px"; floatingBadge.style.zIndex = "9999"; floatingBadge.style.backgroundColor = "#303030"; floatingBadge.style.color = "#f0f0f0"; floatingBadge.style.width = "150px"; floatingBadge.style.height = "30px"; floatingBadge.style.borderRadius = "10px"; floatingBadge.style.textAlign = "center"; floatingBadge.style.padding = "8px 10px 10px 10px"; floatingBadge.style.userSelect = "none"; floatingBadge.innerText = "No badge!"; floatingBadge.id = "floatingBadge"; floatingBadge.ondragstart = function(){return false;} document.body.appendChild(floatingBadge); floatingBadge.onmouseover = function(){floatingBadge.style.cursor = "grab";} floatingBadge.onmouseout = function(){floatingBadge.style.cursor = "default";} function onMouseDown(event){ let shiftX = event.clientX - floatingBadge.getBoundingClientRect().left; let shiftY = event.clientY - floatingBadge.getBoundingClientRect().top; floatingBadge.style.cursor = "grabbing"; //moveAt(event.pageX, event.PageY); function moveAt(pageX, pageY){ floatingBadge.style.left = pageX - shiftX + "px"; floatingBadge.style.top = pageY - shiftY + "px"; } function onMouseMove(event){ moveAt(event.pageX,event.pageY); } document.addEventListener("mousemove",onMouseMove,true); function onMouseUp(){ floatingBadge.style.cursor = "grab"; document.removeEventListener("mousemove",onMouseMove,true); floatingBadge.removeEventListener("mouseup",onMouseUp,true); } floatingBadge.addEventListener("mouseup",onMouseUp,true); } floatingBadge.addEventListener("mousedown",onMouseDown,true); floatingBadge.addEventListener("click",pasteBadge); Вот код создаваемого элемента, который можно перетаскивать. Вопрос состоит в том что мне нужно чтобы после окончания перетаскивания не срабатывало событие click.