Seeking assistance with a coding dilemma. Here is the existing code snippet:
<section>
<span class="tags"></span>
<label for="shoes">Shoes</label>
<input type="checkbox" id="shoes">
<label for="jeans">Jeans</label>
<input type="checkbox" id="jeans">
<label for="tops">Tops</label>
<input type="checkbox" id="tops">
</section>
<section>
<span class="tags"></span>
<label for="monkey">monkey</label>
<input type="checkbox" id="monkey">
<label for="lion">lion</label>
<input type="checkbox" id="lion">
<label for="dog">dog</label>
<input type="checkbox" id="dog">
</section>
Each 'section' is generated dynamically. I am struggling to figure out how to insert the value of each input into the respective span within the section when checked. I have attempted using Arrays, but the dynamic nature of the sections is causing issues.
Could anyone lend me a hand with this? Your help would be greatly appreciated.