Canvas relative position

I have been playing around with the canvas element in HTML5 and I am trying to get the canvas relative position. I am using the layerX and layerY which seems like the most obvious solution but for …