i’ve to find the div within the “para” class which is visible at the moment.
I tried:
$('.para div[style="display: block;"]').attr("id")
but it doesn’t work.
I also wrote an example on js fiddle –> http://jsfiddle.net/JZFgp/3/
I’m thankful for any hints and solutions.
Mario
That will work fine, but your markup is invalid in the fiddle. Here’s a fixed version:
Without the
tableandtrelements, the browser does its best to interpret your markup and ends up just removing thetd(in Chrome at least), which means the.parapart of your selector can no longer match.Edit
It looks like Chrome (most likely others too but I haven’t tested) is quite happy for you to omit the
trelement, as long as there is atableelement. It automatically adds atbodyandtraround yourtdelements.