JSFiddle - React, Tailwind, and code Playground
by thecodeparadox
HTML
<dl>
<dt><a href="/">Colors</a></dt>
<dd>
<ol>
<li><a href="/">White</a></li>
<li><a href="/">Blue</a></li>
<li><a href="/">Red</a></li>
<li><a href="/">Green</a></li>
<li><a href="/">Orange</a></li>
</ol>
</dd>
<dt><a href="" class="agree">Agree</a></dt>
</dl>
<dl>
<dt><a href="/">Shapes</a></dt>
<dd>
<ol>
<li><a href="/">Square</a></li>
<li><a href="/">Circle</a></li>
<li><a href="/">Triangle</a></li>
<li><a href="/">Rectangle</a></li>
<li><a href="/">Hexagon</a></li>
</ol>
</dd>
<dt><a href="" class="agree">Agree</a></dt>
</dl>
JavaScript
$('.agree').click(function(e) {
e.preventDefault();
var items = $(this).parent().closest('dd').find('ol').children('li');
$(items).each(function() {
alert($(this).text());
});
});