Hello Everyone I want to capture label name(72*30) using the following code:
$("input[type = 'radio']:checked:last").each(function() {
var idVal = $(this).attr("id");
var a = $("label[for='"+idVal+"']").text();
alert(a);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<li class="radio">
<input class="tmcp-field nav nav-pills dimension-layer-dimension tm-epo-field tmcp-radio" type="radio">
<label id="tmcp_radio_9" >72*30</label>
<span class="price tc-price hidden">
<span class="amount">20 <i class="fa fa-inr"></i></span>
</span>
</li>
But the code doesn't alert anything. What is wrong?