2

I have the following HTML structure:

<p>Hello world!</p>

If i clicked on the 'w' character using a mousedown jQuery event, how can i convert the e.pageX to the correct character position inside the paragraph element?

Danny Beckett
  • 20,529
  • 24
  • 107
  • 134
hiddenUser
  • 674
  • 1
  • 7
  • 19
  • Really What do you wanna do with That...... :D – Alireza Masali Apr 30 '13 at 05:52
  • I want to make a simple text annotator, so i want to be able to select whatever text there's regardless of any styling element that exists. I tried looking the window.getSelection but i don't know how would that help. – hiddenUser Apr 30 '13 at 06:01
  • Perhaps this question is the simple case of this one: http://stackoverflow.com/questions/2955244/html-selection-range-getting-the-range-starting-node-ending-node-dista?rq=1 – hiddenUser Apr 30 '13 at 06:04

0 Answers0