title: jquery - find 'label' element by 'for' attribute and reset 'for' attribute to new value
body: <p>I've searched and have found the following to fetch the label.</p>
  
  <pre><code>var label = $("label").attr("for", id);
  </code></pre>
  
  <p>my initial attempt was to try a variant:</p>
  
  <pre><code>$('label[for|="'+oldId+'"]').attr('for',newId);
  </code></pre>
  
  <p>where oldId is the current value and newId is the new value.
  I don't get an error, but nothing gets changed.</p>
  
  <p>I also tried just fetching the id of the label so I could find the element by id and change the attribute value, but when I try:</p>
  
  <pre><code>var label = $("label").attr("for", oldId);
  var id = label.id;
  </code></pre>
  
  <p>I get id as undefined.</p>
  
  <p>So, basically I want to:
  - find a label element by it's for attribute.
  - reset the for attribute to a new value.</p>