title: Select radio button on click with jQuery
body: <p>I'm trying to select a radio button on click with jQuery. I can't seem to get this to work though. Here is my current attempt.</p>
  
  <h1>JS</h1>
  
  <pre><code>$(document).ready(function() {
    $("#payment").click(function(event) {
      event.preventDefault()
      $("input:radio[name=slug_tier_1]").attr("checked", true)
    })
  });
  </code></pre>
  
  <h1>HTML</h1>
  
  <pre><code>  &lt;label class="plans__tier-1__actions"&gt;
      &lt;%= radio_button_tag "slug", "tier_1", required: true %&gt;
      &lt;a href="#" class="button" id="payment"&gt;Select&lt;/a&gt;
    &lt;/label&gt;
  </code></pre>
  
  <h1>Screenshot of name</h1>
  
  <p><a href="https://i.stack.imgur.com/GaPlt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GaPlt.png" alt="enter image description here"></a>
  This seems as though it should work? Any thing jump out at you?</p>