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
use jQuery because it allows me to filter the text according to the class it
is part of, by doing something in the style of:

$('td.selectable').each(function() {
var text = this.innerHTML;
alert(text);
})

My problem is that I cannot find an equivalent to window.getSelection() in
jQuery, nor use getSelection() with the jQuery objects (once again, beginner
alert, maybe I'm missing something obvious here).

So, what would you do in order to restrict the returned text to the part of
the DOM that is currently selected (highlighted)?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/jQuery-specific-selected-%28highlighted%29-text--tp20800335s27240p20800335.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to