jquery Programming Glossary: textrange
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 restoreSelection function containerEl savedSel var textRange document.body.createTextRange textRange.moveToElementText containerEl.. savedSel var textRange document.body.createTextRange textRange.moveToElementText containerEl textRange.collapse true textRange.moveEnd.. textRange.moveToElementText containerEl textRange.collapse true textRange.moveEnd character savedSel.end textRange.moveStart..
Javascript Contenteditable - set Cursor / Caret to index http://stackoverflow.com/questions/16095155/javascript-contenteditable-set-cursor-caret-to-index function containerEl start end var textRange document.body.createTextRange textRange.moveToElementText containerEl.. start end var textRange document.body.createTextRange textRange.moveToElementText containerEl textRange.collapse true textRange.moveEnd.. textRange.moveToElementText containerEl textRange.collapse true textRange.moveEnd character end textRange.moveStart..
jquery Setting cursor position in contenteditable div http://stackoverflow.com/questions/2871081/jquery-setting-cursor-position-in-contenteditable-div node if node return false else if node.createTextRange var textRange node.createTextRange textRange.collapse true textRange.moveEnd.. node.createTextRange var textRange node.createTextRange textRange.collapse true textRange.moveEnd pos textRange.moveStart pos.. textRange node.createTextRange textRange.collapse true textRange.moveEnd pos textRange.moveStart pos textRange.select return..
jquery: select text event http://stackoverflow.com/questions/4367353/jquery-select-text-event function var sel document.selection if sel.type Text var textRange sel.createRange if textRange.text selectCallback textRange.parentElement.. if sel.type Text var textRange sel.createRange if textRange.text selectCallback textRange.parentElement document.onmouseup.. sel.createRange if textRange.text selectCallback textRange.parentElement document.onmouseup mouseOrKeyUpHandler document.onkeyup..
JQuery/Javascript - Search DOM for text and insert HTML http://stackoverflow.com/questions/4489119/jquery-javascript-search-dom-for-text-and-insert-html are native methods for finding text inside a document MSIE textRange.findText Others window.find Manipulate the given textRange if.. textRange.findText Others window.find Manipulate the given textRange if something was found. Those methods should provide much more..
Set cursor position in an input text field http://stackoverflow.com/questions/5755826/set-cursor-position-in-an-input-text-field node if node return false else if node.createTextRange var textRange node.createTextRange textRange.collapse true textRange.moveEnd.. if node.createTextRange var textRange node.createTextRange textRange.collapse true textRange.moveEnd pos textRange.moveStart pos.. var textRange node.createTextRange textRange.collapse true textRange.moveEnd pos textRange.moveStart pos textRange.select return..
how to get selection inside a div using jquery/javascript http://stackoverflow.com/questions/5801347/how-to-get-selection-inside-a-div-using-jquery-javascript Text var selTextRange document.selection.createRange var textRange selTextRange.duplicate textRange.moveToElementText el if selTextRange.compareEndPoints.. var textRange selTextRange.duplicate textRange.moveToElementText el if selTextRange.compareEndPoints EndToStart.. el if selTextRange.compareEndPoints EndToStart textRange 1 selTextRange.compareEndPoints StartToEnd textRange 1 if selTextRange.compareEndPoints..
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 return start start end start selectedTextRange.text.length restoreSelection function containerEl savedSel var textRange document.body.createTextRange textRange.moveToElementText containerEl textRange.collapse true textRange.moveEnd character.. restoreSelection function containerEl savedSel var textRange document.body.createTextRange textRange.moveToElementText containerEl textRange.collapse true textRange.moveEnd character savedSel.end textRange.moveStart character.. function containerEl savedSel var textRange document.body.createTextRange textRange.moveToElementText containerEl textRange.collapse true textRange.moveEnd character savedSel.end textRange.moveStart character savedSel.start textRange.select share..
Javascript Contenteditable - set Cursor / Caret to index http://stackoverflow.com/questions/16095155/javascript-contenteditable-set-cursor-caret-to-index sel.addRange range else if document.selection setSelectionByCharacterOffsets function containerEl start end var textRange document.body.createTextRange textRange.moveToElementText containerEl textRange.collapse true textRange.moveEnd character.. setSelectionByCharacterOffsets function containerEl start end var textRange document.body.createTextRange textRange.moveToElementText containerEl textRange.collapse true textRange.moveEnd character end textRange.moveStart character start.. function containerEl start end var textRange document.body.createTextRange textRange.moveToElementText containerEl textRange.collapse true textRange.moveEnd character end textRange.moveStart character start textRange.select share improve this..
jquery Setting cursor position in contenteditable div http://stackoverflow.com/questions/2871081/jquery-setting-cursor-position-in-contenteditable-div string node instanceof String document.getElementById node node if node return false else if node.createTextRange var textRange node.createTextRange textRange.collapse true textRange.moveEnd pos textRange.moveStart pos textRange.select return true.. node node if node return false else if node.createTextRange var textRange node.createTextRange textRange.collapse true textRange.moveEnd pos textRange.moveStart pos textRange.select return true else if node.setSelectionRange.. node if node return false else if node.createTextRange var textRange node.createTextRange textRange.collapse true textRange.moveEnd pos textRange.moveStart pos textRange.select return true else if node.setSelectionRange node.setSelectionRange..
jquery: select text event http://stackoverflow.com/questions/4367353/jquery-select-text-event typeof document.selection undefined IE mouseOrKeyUpHandler function var sel document.selection if sel.type Text var textRange sel.createRange if textRange.text selectCallback textRange.parentElement document.onmouseup mouseOrKeyUpHandler document.onkeyup.. IE mouseOrKeyUpHandler function var sel document.selection if sel.type Text var textRange sel.createRange if textRange.text selectCallback textRange.parentElement document.onmouseup mouseOrKeyUpHandler document.onkeyup mouseOrKeyUpHandler.. function var sel document.selection if sel.type Text var textRange sel.createRange if textRange.text selectCallback textRange.parentElement document.onmouseup mouseOrKeyUpHandler document.onkeyup mouseOrKeyUpHandler share improve this answer..
JQuery/Javascript - Search DOM for text and insert HTML http://stackoverflow.com/questions/4489119/jquery-javascript-search-dom-for-text-and-insert-html html dom insert share improve this question There are native methods for finding text inside a document MSIE textRange.findText Others window.find Manipulate the given textRange if something was found. Those methods should provide much more.. are native methods for finding text inside a document MSIE textRange.findText Others window.find Manipulate the given textRange if something was found. Those methods should provide much more performance than the traversing of the whole document. Example..
Set cursor position in an input text field http://stackoverflow.com/questions/5755826/set-cursor-position-in-an-input-text-field string node instanceof String document.getElementById node node if node return false else if node.createTextRange var textRange node.createTextRange textRange.collapse true textRange.moveEnd pos textRange.moveStart pos textRange.select return true.. document.getElementById node node if node return false else if node.createTextRange var textRange node.createTextRange textRange.collapse true textRange.moveEnd pos textRange.moveStart pos textRange.select return true else if node.setSelectionRange.. node node if node return false else if node.createTextRange var textRange node.createTextRange textRange.collapse true textRange.moveEnd pos textRange.moveStart pos textRange.select return true else if node.setSelectionRange node.setSelectionRange pos..
how to get selection inside a div using jquery/javascript http://stackoverflow.com/questions/5801347/how-to-get-selection-inside-a-div-using-jquery-javascript typeof document.selection undefined document.selection.type Text var selTextRange document.selection.createRange var textRange selTextRange.duplicate textRange.moveToElementText el if selTextRange.compareEndPoints EndToStart textRange 1 selTextRange.compareEndPoints.. document.selection.type Text var selTextRange document.selection.createRange var textRange selTextRange.duplicate textRange.moveToElementText el if selTextRange.compareEndPoints EndToStart textRange 1 selTextRange.compareEndPoints StartToEnd textRange.. var textRange selTextRange.duplicate textRange.moveToElementText el if selTextRange.compareEndPoints EndToStart textRange 1 selTextRange.compareEndPoints StartToEnd textRange 1 if selTextRange.compareEndPoints StartToStart textRange 1 textRange.setEndPoint..
|