javascript Programming Glossary: document.body.createtextrange
Drop image into contenteditable in Chrome to the cursor http://stackoverflow.com/questions/10654262/drop-image-into-contenteditable-in-chrome-to-the-cursor x y range.insertNode img Finally the IE way else if document.body.createTextRange range document.body.createTextRange range.moveToPoint x y var.. the IE way else if document.body.createTextRange range document.body.createTextRange range.moveToPoint x y var spanId temp_ Math.random .slice 2..
How to move cursor to end of contenteditable entity http://stackoverflow.com/questions/1125292/how-to-move-cursor-to-end-of-contenteditable-entity else if document.selection IE 8 and lower range document.body.createTextRange Create a range a range is a like the selection but invisible..
Select all DIV text with single mouse click http://stackoverflow.com/questions/1173194/select-all-div-text-with-single-mouse-click selectText containerid if document.selection var range document.body.createTextRange range.moveToElementText document.getElementById containerid..
Persisting the changes of range objects after selection in HTML http://stackoverflow.com/questions/13949059/persisting-the-changes-of-range-objects-after-selection-in-html document.selection.createRange var preSelectionTextRange document.body.createTextRange preSelectionTextRange.moveToElementText containerEl preSelectionTextRange.setEndPoint.. function containerEl savedSel var textRange document.body.createTextRange textRange.moveToElementText containerEl textRange.collapse true..
Javascript Contenteditable - set Cursor / Caret to index http://stackoverflow.com/questions/16095155/javascript-contenteditable-set-cursor-caret-to-index selection else if document.selection IE 8 and lower range document.body.createTextRange Create a range a range is a like the selection but invisible.. function containerEl start end var textRange document.body.createTextRange textRange.moveToElementText containerEl textRange.collapse true..
PHP Remove JavaScript http://stackoverflow.com/questions/1886740/php-remove-javascript s.addRange r else if document.selection var r document.body.createTextRange r.moveToElementText e r.select script ' function remove_javascript..
how to modify the document selection in javascript? http://stackoverflow.com/questions/2075304/how-to-modify-the-document-selection-in-javascript range else IE document.selection.empty var range document.body.createTextRange range.moveToElementText selectTarget range.select return..
How to delete an HTML element inside a div with attribute contentEditable? http://stackoverflow.com/questions/2177958/how-to-delete-an-html-element-inside-a-div-with-attribute-contenteditable if range.compareEndPoints if node.nodeType 1 nodeRange document.body.createTextRange nodeRange.moveToElementText node nodeRange.collapse false return..
contenteditable, set caret at the end of the text (cross-browser) http://stackoverflow.com/questions/4233265/contenteditable-set-caret-at-the-end-of-the-text-cross-browser sel.removeAllRanges sel.addRange range else if typeof document.body.createTextRange undefined var textRange document.body.createTextRange textRange.moveToElementText.. document.body.createTextRange undefined var textRange document.body.createTextRange textRange.moveToElementText el textRange.collapse false textRange.select..
JQuery/Javascript - Search DOM for text and insert HTML http://stackoverflow.com/questions/4489119/jquery-javascript-search-dom-for-text-and-insert-html 0 rng.collapse false rng.insertNode node else if document.body.createTextRange var rng document.body.createTextRange while rng.findText a .. node else if document.body.createTextRange var rng document.body.createTextRange while rng.findText a rng.collapse false rng.pasteHTML ' b '..
Insert link in contenteditable element http://stackoverflow.com/questions/5605401/insert-link-in-contenteditable-element else links containerEl.getElementsByTagName a linkRange document.body.createTextRange for var i 0 i links.length i linkRange.moveToElementText links..
Full text search in HTML ignoring tags / & http://stackoverflow.com/questions/5886858/full-text-search-in-html-ignoring-tags yellow sel.collapseToEnd document.designMode off else if document.body.createTextRange var textRange document.body.createTextRange while textRange.findText.. off else if document.body.createTextRange var textRange document.body.createTextRange while textRange.findText text textRange.execCommand BackColor..
Highlight text range using JavaScript http://stackoverflow.com/questions/6240139/highlight-text-range-using-javascript sel.addRange range else if document.selection document.body.createTextRange var textRange document.body.createTextRange textRange.moveToElementText.. document.body.createTextRange var textRange document.body.createTextRange textRange.moveToElementText el textRange.collapse true textRange.moveEnd..
Calculate Position of selected text javascript/JQuery? http://stackoverflow.com/questions/7991474/calculate-position-of-selected-text-javascript-jquery .type Control range sel.createRange priorRange document.body.createTextRange priorRange.moveToElementText element priorRange.setEndPoint..
|