I have been asked a couple of questions in regards to JQuery and I am not entirely sure on how to answer them?
1 How would you reduce your collection of elements to just spans? 2. Given you have found $('#anID'), how would you add context to a jquery selector to restrict the scope of search for one of its children?
Any help would be greatly appreciated
Thanks
I assume in 'reduce your collection of elements to just spans' you mean 'get all spans in page' - in that case, you can simply do $('span')
(how awesome is that? :) ). For more information, visit JQuery selector documentation.
To find only decedents of an element, you can use .find() method, like this: $('#anID').find('.child-selector')
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments