You could loop over the radio buttons using "each()" and get the next
text node. Untested code follows:

$(':radio').each( function() {
  $( this.nextSibling ).wrap( '<label></label>' );
});

Karl Rudd

On Tue, Mar 25, 2008 at 8:59 AM, Greg G <[EMAIL PROTECTED]> wrote:
>
>  I have a web page that renders radio buttons with text after it.  I
>  want to take that text and wrap a label tag around it but I can't grab
>  the text.
>
>  Here is the HTML:
>  <input type="radio" name="RadioField" type="hidden" value="Y">Yes
>  <input type="radio" name="RadioField" type="hidden" value="N">No
>
>  I can get the radio object and I can get an array the radio objects
>  siblings using ("#radio").each( function(){ $(this).siblings ).
>
>  I can't get the first sibling that's a text node.  I've tried $
>  (this).siblings("[nodeType=3]") but I don't get anything returned.
>  I've also tried to loop through the siblings and see what the node
>  type is but the return value is always "undefined".
>

Reply via email to