title: How to change radio button label generated by drupal using jquery?
body: <p>I have two radio buttons generated by drupal. I also have a textedit box and a button. The user is supposed to enter its id and when the user clicks on the button, there will be an ajax request that will fetch two values from a database. I want those two values to be shown in the radio button labels.</p>
  
  <p>The generated code by Drupal for the radio buttons looks like this:</p>
  
  <pre><code>&lt;div class="form-radios"&gt;
    &lt;div class="form-item" id="edit-new-amount-no-cost-wrapper"&gt;
      &lt;label class="option" for="edit-new-amount-no-cost"&gt;
      &lt;input type="radio" id="edit-new-amount-no-cost" name="new_amount" value="no_cost" class="form-radio" /&gt;
      Item 1
      &lt;/label&gt;
    &lt;/div&gt;
    &lt;div class="form-item" id="edit-new-amount-rounded-wrapper"&gt;
      &lt;label class="option" for="edit-new-amount-rounded"&gt;
      &lt;input type="radio" id="edit-new-amount-rounded" name="new_amount" value="rounded" class="form-radio" /&gt;
      Item 2
      &lt;/label&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>If I do:</p>
  
  <pre><code>alert($("label[for=edit-new-amount-no-cost],#edit-new-amount-no-cost").text());
  </code></pre>
  
  <p>it will output "Item 1" so I tried changing the text using:</p>
  
  <pre><code>$("label[for=edit-new-amount-no-cost],#edit-new-amount-no-cost").text(values[1]);
  </code></pre>
  
  <p>However, then I propably changed the entire label content because the radio button next to "Item 1" disappear :(</p>
  
  <p>Any ideas? I want to change "Item 1" and "Item 2" to specific values from a ajax request. I don't want to change the entire label content because then the radio button will disappear.</p>
  
  <p>Kind regards,
  Samuel</p>