Selectors in jQuery
With the simple $(‘path’) I easily got all vectors in the current document, but the problem was that I took them as text. Thus it came to me to use nested jQuery – $($(‘selector’));
To describe what actually happened in my case, let me show you a breve example.
Here’s a short HTML markup:
With jQuery I can select both the DIV and SPAN with the simple $(‘div’) and $(‘span’), but just for the example lets assume I’ve only the inner text of the DIV tag:
That was the case in the OpenLayers/jQuery problem. Now I can easily use another jQuery selector:
This will return the same as $(‘span’) – a jQuery object.