javascript Programming Glossary: timdown
Select a complete table with javascript (to be copied to clipboard) http://stackoverflow.com/questions/2044616/select-a-complete-table-with-javascript-to-be-copied-to-clipboard didin't work in IE 9 standards mode Demo http jsfiddle.net timdown hGkGp 4 Code script type text javascript function selectElementContents..
contenteditable selected text save and restore http://stackoverflow.com/questions/4687808/contenteditable-selected-text-save-and-restore in here so here's the full code http www.jsfiddle.net timdown cCAWC 3 Extract div id test contenteditable true Some editable..
Javascript: How to detect if a word is highlighted http://stackoverflow.com/questions/4712310/javascript-how-to-detect-if-a-word-is-highlighted work in all major browsers. Example http www.jsfiddle.net timdown SW54T function getSelectedText var text if typeof window.getSelection..
Get caret (cursor) position in contentEditable area containing HTML content http://stackoverflow.com/questions/4767848/get-caret-cursor-position-in-contenteditable-area-containing-html-content that will do it. Here's a live example http jsfiddle.net timdown 2YcaX Here's the function function getCharacterOffsetWithin..
Set caret position right after the inserted element in a contentEditable div http://stackoverflow.com/questions/4834793/set-caret-position-right-after-the-inserted-element-in-a-contenteditable-div to it and then remove it. Live example http jsfiddle.net timdown 4N4ZD Code function insertNodeAtCaret node if typeof window.getSelection..
How to set caret(cursor) position in contenteditable element (div)? http://stackoverflow.com/questions/6249095/how-to-set-caretcursor-position-in-contenteditable-element-div
Insert html at caret in a contenteditable div http://stackoverflow.com/questions/6690752/insert-html-at-caret-in-a-contenteditable-div not to select the inserted content. Demo http jsfiddle.net timdown jwvha 527 Code function pasteHtmlAtCaret html selectPastedContent..
Remove highlight added to selected text using JavaScript? http://stackoverflow.com/questions/8076341/remove-highlight-added-to-selected-text-using-javascript would be a possible addition. Live demo http jsfiddle.net timdown Bvd9d Code snippet function unhighlight node colour if colour..
|