salut , j'utilise un script pour insérer des balises html sur un texte selectionner dans une textarea, par contre j'aimerais comprendre exactement certaines lignes.
si quelqu'un veut bien m'expliquer :
ceci
ceci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
merci @+
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 if (textEl.createTextRange && textEl.caretPos) { var caretPos = textEl.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text; }![]()
Partager