2
<span name="workitemContent" contenteditable="">root 0 child 0 zzzz</span>
例如,我怎樣才能使用量角器在單詞「child」後面設置光標,然後將其他文本(使用sendKeys或類似的方法)發送到該位置的跨度?如何設置contenteditable span中的插入符號位置,然後發送鍵?
此後,它可能看起來像:
<span name="workitemContent" contenteditable="">root 0 child with red hair 0 zzzz</span>
我已經看到這個問題的答案如何使用JavaScript(如How to set caret(cursor) position in contenteditable element (div)?)做到這一點其他問題,但不能與量角器。