Get the offset of a character by wrapping it in a textNode.
npm install textnode-offsetGet the offset of a character by wrapping it in a textNode.
https://lab.miguelmota.com/textnode-offset
``bash`
npm install textnode-offset
`bash`
bower install textnode-offset
`html`Programs must be written for people to read, and only incidentally for machines to execute.
`javascript
var parentElement = document.getElementById('text');
var index = 20;
var offset = textNodeOffset(parentElement, index);
console.log(offset);
//
{
"left": 148.875,
"top": 110.875
}
``
MIT