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 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;...
I'm a little confused why doesn't this code work!  The HTML Markup:  <div id="diva"><b>Score</b> some <i>goals</i></div> <div id="soda"></div>   The JavaScript code:  function Ge...
I'm trying to use the touchend (or the taphold event, both wont fire) as specified by jquery mobile. I'm developping an app for android using the phonegap platform. My AVD runs Android 4.0.3, and my phonegap version is 1.3.0.  As im using pho...
I was testing out the getSelection() method, and I wanted my program to get the selected text in a certain paragraph of text and display it in a div tag. I used the following code:  var txt = document.getSelection(); document.getElementById("disp...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.