$("#rightCol").children().children().children("div.entry").length
I tried this
$("#rightCol").children().eq(1).children("div.entry").length
or
$("#rightCol").children(":eq(1)").children("div.entry").length
without success. ideas?
Depending on the layout (do you have a DIV with this class at other levels that you want to avoid?), You can go through with
$('#rightCol').find('div.entry').length
You can do this using a child selector ( >) , for example:
>
$("#rightCol > * > * > div.entry").length
Although, if you know the type of the child, I would use it over *. If the level does not matter, only the descendant selector ( ) will work .
*
$("#rightCol div.entry").length
, ?
$("#rightCol *:eq(1) div.entry").length
, .
$("#rightCol > * > * > div.entry")
. "div.entry" "#rightCol", .
$("#rightCol div.entry")
Source: https://habr.com/ru/post/1770766/More articles:Generating an ASP.NET session timeout in a GeneXus application - loginBe careful with version numbers for downloading signed assemblies - reflectionReset semaphore - multithreadingProblems with gallery layouts - androidHow do I popViewControllerAnimated after a delay? - iosCreating a Django admin action to duplicate a record - djangoms-access: when I change the extension to ACCDR, forms / tables disappear - vbaDo .php files without any PHP in them are passed to the interpreter? - performanceIs python time module reliable enough to measure response time? - pythonMake the command line open when the bat file is run - batch-fileAll Articles