I am having two input elements of type text inside bootstrap panel. I am trying to get count of visible elements inside collapsed div.
<div class="container">
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse1">Collapsible Group 1</a>
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse">
<div id="inside"
<label for="txt_1">Name</label>
<input id="txt_1" type="text">
<label for="txt_2" style="display:none;">Age</label>
<input id="txt_2" type="text" style="display:none;">
</div>
</div>
</div>
</div>
</div>
When i try to use below statement with panel expand i can get the length 1.
$('.panel input:visible').length
But the same line results 0 when panel is in collapsed state. Is there any i can achieve this ? Thanks in advance.