How to write the selector?
Hi,
how can I select a list-item which is 3rd-Element and has a child span with a class?
- var paginationUl = jQuery('ul.pagination'),
- paginationLi = jQuery('li', paginationUl),
- firstLiNotCLass = jQuery('li:not([class])', paginationUl),
- paginationStart = jQuery('.pagination-start', paginationUl),
- paginationPrev = jQuery('.pagination-prev', paginationUl),
- paginationNext = jQuery('.pagination-next', paginationUl),
- paginationEnd = jQuery('.pagination-end', paginationUl);
- if(jQuery(paginationLi).is(':nth-child(3)').children('span.active')) {
- paginationStart.remove();
- paginationPrev.remove();
- }
Here I got the error "Object true has no method children".