title: Dynamically checked radio button, based on 'value' attribute, not checking
body: <p>Trying to get a form to load pages with the previously checked radios already checked (upon a fresh load).</p>
  
  <p>The submissions of that page are held as php variables which I can pass into the javascript, the rest should be simple, but it's not working for me.</p>
  
  <p>My code:</p>
  
  <pre><code>&lt;div class="question"&gt;
              &lt;label for="sv_213"&gt;Question?&lt;/label&gt; 
              &lt;input 
                      class="radio"
                      type="radio" 
                      value="Yes" 
                      name="sv_213" 
                  /&gt;Yes
              &lt;input 
                      class="radio"
                      type="radio" 
                      value="No" 
                      name="sv_213"
                  /&gt;No
  
          &lt;/div&gt;
  </code></pre>
  
  <p>My javascript:</p>
  
  <pre><code>$(function() {
      var $213 = Yes;
      $("input[name='sv_213'][value="$213"]").attr('checked', true);
  
      });?
  </code></pre>
  
  <p>In the above js the</p>
  
  <pre><code>var $213 = &lt;dynamically generated content&gt;
  </code></pre>
  
  <p>Such that it is set equal to the value of the radio button that was checked</p>
  
  <p>Here is a js fiddle with it not working:
  <a href="http://jsfiddle.net/CW8AC/" rel="nofollow noreferrer">http://jsfiddle.net/CW8AC/</a></p>
  
  <p>Many thanks for any help.</p>
  
  <p>Incidentally my code is based on this, previously asked question:
  <a href="https://stackoverflow.com/questions/4618733/set-selected-radio-from-radio-group-with-a-value">Set selected radio from radio group with a value</a></p>