Im trying to test a feature with automation tool, cypress. As it does not allow selection of text by default, I need to do it in JS.
I want to select a word from a sentence and do some styling with it. Example : "This is a text" . When I highlight a word 'text', the tool bar for 'B, I, U' shows up. So now I want to programettically want to highlight some text so that I can click on tool bar to do some styling of the text selected.
Any idea how to do it in javascript.