Answer by Lix for Getting the id of a div which is being displayed
jQuery has a dedicated :visible selector. You can use this to match any element that is being displayed.https://api.jquery.com/visible-selector/Elements are considered visible if they consume space in...
View ArticleAnswer by Brijesh Bhatt for Getting the id of a div which is being displayed
You can use .not() which remove the elements from the set of matched elements. var divId = $("div.items").not(":hidden").prop("id");Working Demo
View ArticleAnswer by Rory McCrossan for Getting the id of a div which is being displayed
You can use the :visible selector:var visibleId = $('.items:visible').prop('id'); // = 'items2'
View ArticleGetting the id of a div which is being displayed
I have the following HTML code:<div id="skills"><div class="items" id="items1" style="display:none">1</div><div class="items" id="items2">2</div><div class="items"...
View Article
More Pages to Explore .....