i am trying to select value for the selected button like the following :
html code :
<div class="span3">
<div>DEBIT/CREDIT</div>
<div class="btn-group" data-toggle="buttons-radio" id="investadjust-debitcredit-button">
<button name="debitCredit" type="button" id="credit-button" class="btn active" value="CREDIT" >CREDIT</button>
<button name="debitCredit" type="button" id="debi-button" class="btn" value="DEBIT" >DEBIT</button>
</div>
</div>
javascript code :
$("#investadjust-debitcredit-button>.active").val()
but i get only empty when i printed the above line after selecting one button.
what could be the reason.
you need to place your code in
$(document).ready(function(){
// your jquery code
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With