Found the solution

Code:
	document.getElementById("d"+dotNr).addEventListener("mousedown",function(event){
		mouseDownDrag(this.id);
	});