I have been trying to work with this jquery script for 2 hours and nothing has improved throughout changes.
I have this result tab working now, and what I would like to add is the <div id="counts"></div>
container that would show the total numbers of results being counted as they're shown up. Lets say there's one result the <div id="counts">1</div>
container has "1", etc. If there's no result then leave container with "0".
这是我当前的编码:
$('#search').on('change keyup', function() {
checkForInput(this);
var rowCount = $('.product_listing.value a').length;
document.getElementById('counts').innerHTML = rowCount;
});
<ul class="list-group no" id="result">
**<div id="counts"></div>**
<div class="product_listing">
<a>RESULT</a>
<a>RESULT</a>
<a>RESULT</a>
</div>
</ul>