I want to trigger a keyboard event to press "right arrow" key. The purpose is to cancel the highlight.
I used the code below to insert a hyper link into the editor content.
var range = document.getSelection().getRangeAt(0);
var nnode = document.createElement("a");
range.surroundContents(nnode);
nnode.innerHTML = url;
nnode.setAttribute(url);
nnode.focus();
It is highlight by default. I want to trigger an "right arrow" key in order to cancel the highlight and move the cursor to the right. I did many searchs, I tried the most of solutions, but I still get one works. My environment is IE 11.
Can I get some help?
Thanks!