2

I am trying to find the coordinates (x,y) value of all words in html. I have tried to add <span> for each word </span> and find using

var rect = el.getBoundingClientRect()

above is working fine. But my question is, how can i get the position of words without wrapping the words with additional tags as mentioned above ? or is it possible to do so ?

backtrack
  • 7,996
  • 5
  • 52
  • 99
  • [This thread](https://stackoverflow.com/questions/442404/retrieve-the-position-x-y-of-an-html-element) about retrieving the position (X,Y) of an HTML element might be helpful. – Michael Hurley Sep 24 '18 at 15:46
  • 1
    @MichaelHurley - Thank you for sharing the link, above link will work if i wrap the text with some html tag. – backtrack Sep 24 '18 at 16:54
  • Ah I see your meaning now thanks for the clarification. I do not believe that javascript is capable of finding the coordinates of text content inside of elements. – Michael Hurley Sep 24 '18 at 16:58
  • @MichaelHurley - Yes i am trying with Jquery, still no solution – backtrack Sep 24 '18 at 17:10

0 Answers0