I am trying to pass unique passnum value to different zone information using jquery, so that the passnum information is specific to a specific zone.
for example zone1 may passnum = 100 and zone2 may have 50
Is it possible to pass the unique passnum value to each of the zones<h5> </h5>based on the zone using jquery? since there could be hundreds of zone blocks dynamically created.
<div class="wrapper" class="zone1">
other divs here (could have unknown amount of div block or tages here
<div ><span class="pass-num"><h5>some num </h5></span> </div>
</div>
<div class="wrapper" class="zone2">
other divs here (could have unknown amount of div block or tages here
<div><span class="pass-num"><h5>some num(pass val here) </h5></span> </div>
</div>
I have cthe ode below which works when u know the zone and structure
$(document).ready(function() {
var passnum ="110";
var passtext="All";
$('div.pass-text>h4').text(passtext);
$('div.pass-num>h4').text(passnum);
});
</script>
Given your html, this function should do it:
Use it like:
See working demo