# Handeling test selection programatically (caret manipulation)

**URL:** <https://pdfjs.community/t/handeling-test-selection-programatically-caret-manipulation/408>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [December 6, 2020, 2:12pm UTC](https://pdfjs.community/t/handeling-test-selection-programatically-caret-manipulation/408 "2020-12-06T14:12:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [December 8, 2020, 3:24pm UTC](https://pdfjs.community/t/handeling-test-selection-programatically-caret-manipulation/408/2 "2020-12-08T15:24:54Z")

</div>

Hi there!

Instead of `documentLoaded`, try using the [`annotationsLoaded`](https://pdfjs.express/api/CoreControls.DocumentViewer.html#event:annotationsLoaded__anchor) event. This will be fired after all the inputs are loaded.

Regarding your second question, I’m not to sure what you mean. Can you give a bit more detail about what you mean here?

Thanks!  
Logan

---

_[View the full topic](https://pdfjs.community/t/handeling-test-selection-programatically-caret-manipulation/408)._
