javascript - Value becomes empty when selecting button -


my 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 data:

 $("#investadjust-debitcredit-button>.active").val() 

when load page values empty value because of unable value of selected button.

how resolve this.

first of all, dont think switching between button or input elements help. jquery entirely independent of that

well, have not mentioned javascript, can use following code selected button value: -

$(".active", $(".btn-group")).val() 

try alerting above sentence , ll wat u r looking


Comments

Popular posts from this blog

mod rewrite - Using "?" when rewriting the URL -

.htaccess: Transfer name to index.php if not directory public -

Admob integration with pygame in android -