简体   繁体   中英

Select table value based on radio button

I'm new to jquery and need some help.

I would like jquery to select a value inside the Quantities table cell, depending on whether or not a radio button within the table row has been selected.

you can see a screenshot of the table here .

The table name is tblOfferings ; the radio button name is rdbOfferings ; the td Offerings name is offerQuant .

my attempt so far

Quantities = jQuery("td>span:contains('offerQuant')").closest("input[name='rdbOffering']:checked").find('offerQuant').val();

help?

quantity = $('input[name="rdbOffering"]:checked').parents('tr').find('td.offerQuant').text();

i hope that's what you mean

check this http://jsfiddle.net/bondythegreat/Ycm7L/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM