There is such a layout with radio buttons
<ul> <li> <span class="pistons">4<br/>цилиндра</span> <b>220 000</b> <input name="group1" type="radio" id="test1" class="with-gap" checked="" value="220 000"/> <label for="test1"> </label> </li> <li> <span class="pistons">6<br/>цилиндров</span> <b>280 000</b> <input name="group1" type="radio" id="test2" class="with-gap" value="280 000"/> <label for="test2"> </label> </li> <li> <span class="pistons">8<br/>цилиндров</span> <b>350 000</b> <input name="group1" type="radio" id="test3" class="with-gap" value="350 000"/> <label for="test3"> </label> </li> </ul> When I click the button, I want to get the value of the span class = "pistons" with the radio button selected. I do like this
$(".order_lovato").click(function () { var $this = $('input[name=group1]:checked'); var itemBox = '.pistons'; var $thisItem = $this.closest(itemBox); console.log($thisItem.html()); }); But does not work. what could be the problem?