Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get position of every character

Tags:

javascript

dom

How to get position (left, top) of every characters in some node? I know just one method: wrap every character in it's own tag and then we can get it's coordinate. But it's bit slowly

like image 908
anton_byrna Avatar asked Oct 14 '25 14:10

anton_byrna


1 Answers

I've found answer on my question — Range interface can present all information that I need (More info — http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html).

like image 164
anton_byrna Avatar answered Oct 17 '25 04:10

anton_byrna