JSFiddle - React, Tailwind, and code Playground

by Danijel

HTML

<div> 
    <ul class="AspNet-CheckBoxList-RepeatDirection-Vertical">
        <li class="AspNet-CheckBoxList-Item">
            <input id="CheckBoxList1_0" type="checkbox" name="CheckBoxList1$0"  value="first1" />
            <label for="CheckBoxList1_0">First $30.00</label>
        </li>
        <li class="AspNet-CheckBoxList-Item">
            <input id="CheckBoxList1_1" type="checkbox" name="CheckBoxList1$1" value="second2" />
            <label for="CheckBoxList1_1">Second $25.00</label>
        </li>
     </ul>
</div>

JavaScript

$("li").on( 'click', function() {
    $("input:checked").each( function() {
        console.log( $( "label[for='" + $(this).attr('id') + "']" ).text() );
    });
});