Hello,
I'm still a beginner with jQuery (and not really fluent in JavaScript), but
I begin to understand how it works.
I am trying to move the following code to jQuery:
var text = window.getSelection();
alert(text);
It shows me the currently highlighted part of an xhtml page. Now I want to
us
Ryura wrote:
>
> The glue code is converting your jQuery object.
>
> var text = $('div.selectable')[0].getSelection();
> alert(text);
>
> [0] takes the first element you selected and "removes" the jQuery
> methods, "replacing" them with the usual DOM methods.
> I don't know how supported .get
Hello,
Sorry if my question is not worded properly, I'm new to jQuery and still do
not understand its syntax. I've read a lot of examples and it did not help
me much.
I've got this really simple JS function:
function getActiveText(e) {
var text = window.getSelection();
alert(te
ricardobeat wrote:
>
> Hi there,
>
> Where in the example is the class 'third' you mentioned?
>
It was in my test text at various random places for the example, but I still
have not figured how to post snippets without parts of it being
eaten/interpreted as html by the list. Still new with t
SLR wrote:
>
> First off, I'm also new to jQuery so I apologize if my solution is the
> best way to do this. Anyways, here's what I came up with
>
It looks like we are not far from my goal. I tested a (slightly modified)
version of your suggestion and it returns me something more satisfying th
Hello,
Consider the code snippet at the end of the post.
It alert()s me by returning the selected text.
The problem is that window.getSelection() only returns plain text. No
indication of the html tags, of the classes, nor any kind of DOM.
I think that jQuery has something more complete than
6 matches
Mail list logo