title: Jquery xpath selector
body: <p>Ok so I have an element with radio buttons, and I clone this element when an add button is clicked; however, once I do so, the button on the initial element is unchecked. I know why this happens, but once I began to implement a work around it doesn't do as I expect.</p>
  
  <p>Here was my solution:</p>
  
  <pre><code>    //This stores the value of the checked element into a variable before the clone
      var radioKeep = $('input.event'+(numOfParts-1)+':checked').val();
  
      //Cloned the element passed into the function
      $(element).parent().clone(true, false).insertAfter($(element).parent());
  </code></pre>
  
  <p>Then after the clone I try to make sure the initial radio button is re-checked with the following combination of jquery and xpath.</p>
  
  <pre><code>    $('input.event'+(numOfParts-1)+'[@value='+radioKeep+']').attr('checked', 'checked');
  </code></pre>
  
  <p>The result is that all radio elements are checked... why???</p>
  
  <p>Thanks in advance.</p>