For each name, you have only to store the target position (positions to reach) an to calculate the distance with the drop position. If the distance(*) is less than few pixels (3, 7 or 15px, it depends of the scale), the script takes the target coordinates instead of the proposed by the user to let the name at the right place, otherwise the image is returned to its original position (which is given by this.ox and this.oy)...
// For example you define the names (a comma separated string to split in an array)
var arrNames="Aorta,Vena cava,right atrium,...".split(',');
// And the coordinates to reach (two values for each name - example only)
// You build you movable names to display in the page
for (var i=0;i<arrNames.length;ii++) str+='<p id="nms'+i+'" class="drag">'+arrNames[i]+'</p>';
When the user drag a name, you have only (in the mouseup function) to find its id this.trgObj.id
which gives the value of its index
and, finally, compare this.trgObj.offsetLeft
the corresponding coordinates where the name should be placed (a variant with an array of object with three keys name, left and top would be more readable).
See too the HTML tags map
which could perhaps be useful...
You can choose many distances like : the Euclidian Math.sqrt(deltaLeft*deltaLeft+deltaTop*deltaTop) or others Math.abs(deltaLeft)+Math.abs(deltaTop) or Math.abs(deltaLeft+deltaTop)+Math.abs(deltaLeft-deltaTop)