Minko Gechev on Twitter: "Tip: in JavaScript you can an get element by a position relative to the viewport No need for heavy computations trying to match the cursor position to the
![How To Find The Caret Inside A Contenteditable Element | by Konstantin Münster | JavaScript in Plain English How To Find The Caret Inside A Contenteditable Element | by Konstantin Münster | JavaScript in Plain English](https://miro.medium.com/max/1200/1*UtM9VEBCuDq4aC2spcZtTA.png)
How To Find The Caret Inside A Contenteditable Element | by Konstantin Münster | JavaScript in Plain English
![Step-by-step guide: Pass your cursor position to CSS variables with JavaScript - DEV Community 👩💻👨💻 Step-by-step guide: Pass your cursor position to CSS variables with JavaScript - DEV Community 👩💻👨💻](https://res.cloudinary.com/practicaldev/image/fetch/s--dIJv4oZr--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0zubogzgqli7k69orwqd.jpg)