I'd like to get the input value by the label class using Javascript, not Jquery. My html code is:
<label class="btn btn-secondary button-calculator">
<input type="radio" name="units[]" id="units1" value="1" autocomplete="off"> US units
</label>
<label class="btn btn-secondary button-calculator active">
<input type="radio" name="units[]" id="units2" value="2" autocomplete="off" checked=""> Metric units
</label>
I've tried with
document.getElementsByClassName("active").children
and
document.getElementsByClassName("active").value
and checking the console.log values but i don't get anything useful.
Thanks in advance.