I've got a script that changes the background colour of text that has been selected. However i'm encountering an issue when the text is selected across multiple elements/tags.   The code that i've got is:  var text = window.getSelection()...
I'm forgetting about cross-browser compatibility for the moment, I just want this to work. What I'm doing is trying to modify a script (and you probably don't need to know this) located at typegreek.com The basic script is found here. Bas...
I am trying to find the textual start and end of the selection.  So, in the following text, if I selected "world! What a fine" from within "Hello, world! What a fine day it is!", I should get 7 as the start coordinate, and 24 as the e...
I'm working on a Chrome extension that will extract a plain text url from a selection, but the selection will always be a fraction of the url, so I need to scan left and right. I basically need to extract 500 characters around the selection from...
I have reference the answer here Select whole word with getSelection. I would like to make a mouseup selection completed words from body. than wrap <p> tag for the selection words. Here is the code. So how to? Thanks.  <script src="jquer...
I have a contenteditable div and want to get the user's selection when they click a span.  My problem is that when I click the span, the selection gets unselected so window.getSelection().toString() returns ''.  How can I get this to work...
i have big trouble trying to get the value of the selected slice of a PieChart when its clicked.  The documentation says:     selection_array: An array of selected objects, each one describing a   data element in the underlying table used to create t...
I am dynamically filling textarea using Ajax call's. In my code, I want to get the  cursor's  current line content using window.getSelection.  I tried following code,  var range = window.getSelection().toString;...
In chrome or Safari browser, when I select the text on the page I can get the Selection-info by window.getSelection(), And it worked on iPad too. But when I just click , in browser, I will get a window.getSelection (isCollapsed==true)  with full info...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.