How can i determine the position of textarea cursor relative to the window in x,y?
<p>I am trying to create a javascript code editor just for learning and I am doing a great job so far. The only thing is that I wanna place the autocomplete box in a position relative to the text cursor in textarea. So how can I determine the cursor position relative to the upper left corner of the window ?    </p>

<p>Something else please, how can i capture the tab &amp; enter keys press in a textarea ?</p>

<p>I am using a semi-transparent textarea (semi to keep the cursor blinking) with underlying div to enable code highlighting later on. Is this the best technique to do that ? Or there is a way to make textarea accept rich text or HTML ?</p>
