This could be the most effective way to achieve this task :)
id = $(".se[style*='display:block']").attr("id");
However, it is important to consider multiple instances when using classes as selectors, as there may be several div elements that need to be accessed. In such cases, try this approach instead:
$(".se[style*='display:block']").each(function(){
//You can perform actions on each element here
// Use `this` as a selector, for example
id = this.attr('id');
});
A quick note:
Ensure that your selectors accurately target the desired item in terms of CSS. For instance,
style = $('element').attr('style');
will only retrieve values from the actual HTML element like
<div style="display:block"
.
To access style values set in the CSS, utilize the appropriate selector.
http://jsfiddle.net/4jVC8/
Remember that these are distinct aspects!
Here's another filtering version:
$('div.se').filter(function() {
return ( $(this).css('display') == 'block');
});