Quantcast
Channel: Getting the id of a div which is being displayed - Stack Overflow
Browsing all 4 articles
Browse latest View live

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 Article



Answer 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 Article

Answer 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 Article

Getting 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
Browsing all 4 articles
Browse latest View live




Latest Images