In JavaScript, there is a method window.getSelection()
, that lets me get the current selection that the user has made.
Is there a corresponding function, something like window.setSelection()
, that will let me set, or clear, the current selection?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…