Hi Carrajo,
W3C HTML specs says: associate a label with a form control.
There are two standards ways to makup the label element - explicitly and implicity.
See: http://www.w3.org/TR/REC-html40/interact/forms.html#edef-LABEL

So, lets rewrite your markup using label implicity:

<label><input name="make" type="radio" value="Honda" id="radio-a"> Honda</label> <label><input name="make" type="radio" value="Toyota" id="radio-b"> Toyota</label> <label><input name="make" type="radio" value="Mazda" id="radio-c"> Mazda</label>

Now jQuery code to achieve your goal:

$('input[name=make]').parent('label:last-child').after(' <label><input name="make" type="radio" value="Ford" id="radio-d"> Ford</label>');

and you are able to insert more inputs the same way:

$('input[name=make]').parent('label:last-child').after(' <label><input name="make" type="radio" value="Chevrolet" id="radio-d"> Chevrolet</label>');

Regards,
MaurĂ­cio

---------------------------------------
These are the radio buttons on my form

<input name="make" type="radio" value="Honda" id="radio-a"> Honda
<input name="make" type="radio" value="Toyota" id="radio-b"> Toyota
<input name="make" type="radio" value="Mazda" id="radio-c"> Mazda

Using jquery how can I add another selection to the list? Something
like
$label.append('<input name="make" type="radio" value="Ford" id="radio-
d"> Ford'); ? I can't figure out the syntax.
Any help please.
Thanks

Reply via email to