[jQuery] Re: First steps in jQuery: trying to figure the syntax to mix standard Javascript with jQuery

2008-12-02 Thread Ryura
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 .getSelection() is so this code may not

[jQuery] Re: First steps in jQuery: trying to figure the syntax to mix standard Javascript with jQuery

2008-12-02 Thread stephane_r
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 .getSelection()

[jQuery] Re: First steps in jQuery: trying to figure the syntax to mix standard Javascript with jQuery

2008-12-02 Thread MorningZ
For: what is enclosed in divs of the class selectable http://docs.jquery.com/Attributes/html $('div.selectable').html() or http://docs.jquery.com/Attributes/text $('div.selectable').text() you may need to loop through them () if there are more than one

[jQuery] Re: First steps in jQuery: trying to figure the syntax to mix standard Javascript with jQuery

2008-12-02 Thread Michael Geary
Actually the [0] doesn't convert anything, and it doesn't remove or replace any methods. You could think of it that way, but here's a more accurate way to look at it: The jQuery object is an array of DOM elements. (It's not an actual Array object, but it is an array-like object with [0], [1],