Look for function atan2 which takes dy and dx as parameters.
Just to add onto this, the atan2 function will return radians. To get to degrees, multiply by (180/pi):
var degrees = Math.atan2(y2-y1,x2-x1) * (180/Math.PI);[/code:jyyxq4ol]
You could have undoubtedly found this solution by googling "Calculate angle between 2 points in javascript".