1 2 3 4 5 6 7 8 9 10 11 12 13 14 | function storeCaret (textEl) { if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate(); } function insertAtCaret (textEl, text) { if (textEl.createTextRange && textEl.caretPos) { var caretPos = textEl.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text; } else textEl.value = text; } |
1 | <TEXTAREA onkeyup=storeCaret(this); onclick=storeCaret(this); name=tekst etc...> |
1 | <A href="javascript:insertAtCaret(this.edit.tekst,'smiley-string');"> |
|
Forum Opties | |
---|---|
Forumhop: | |
Hop naar: |