Vladimir Potapov
Vladimir Potapov

Reputation: 2437

How to change RadioButtonList Name

This my HTML:

<table id="WizardSRS_rb_list" border="0">
<tbody>
<tr>
<td>
<input id="WizardSRS_rb_list_1" type="radio" value="No" name="WizardSRS:rb_list">
<label for="WizardSRS_rb_list_1">No</label>
</td>
</tr>
</tbody>
</table>

I can get to

<input id="WizardSRS_rb_list_1" type="radio" value="No" name="WizardSRS:rb_list">

and change the value but the

<label for="WizardSRS_rb_list_1">No</label>

still showing "No" and this is normal,because i need to change text in the

<label for="WizardSRS_rb_list_1">No</label>

but how cat i do this?in first it easy to get $("#ID") but how to get to this for="WizardSRS" object?

Upvotes: 0

Views: 82

Answers (3)

Jay Patel
Jay Patel

Reputation: 647

You could do do what Arun suggested above or for faster access, just give label and `id' and access using that.

Upvotes: 0

Arun P Johny
Arun P Johny

Reputation: 388316

You can

$('#WizardSRS_rb_list_1').next().html('No')

or use the attribute selector

$('label[for="WizardSRS_rb_list_1"]').html('no')

Upvotes: 0

achudars
achudars

Reputation: 1506

In jQuery:

$( "<label for='WizardSRS_rb_list_1'>No</label>" ).appendTo( "body" );
$( "<label for='SOMETHING_ELSE_rb_list_1'>YES</label>" ).appendTo( "body" );

Upvotes: 1

Related Questions