Question

Comment puis-je rendre une sélection de page programmée visible pour l'utilisateur, comme si elle avait été sélectionnée par l'utilisateur?

var range = document.createRange();
var startPar = [some node];
var endLi = [some other node];
range.setStart(startPar,13);
range.setEnd(endLi,17);

Merci.

Était-ce utile?

La solution

Utiliser:

window.getSelection().addRange(range);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top