title: Add a rule for `:checked` in a jquery object variable
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let input = $('div').find('input');
  
  $('button').on('click', () =&gt; {
      if (input.is(':checked')){
      $('p').html(input.val());
    }
    else {
      $('p').html("No value provided");
    }
          
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div id="radio-div"&gt;
    &lt;input type="radio" id="y" name="yorn" value="Yes"&gt;
    &lt;label for="y"&gt;Yes&lt;/label&gt;&lt;br&gt;
    &lt;input type="radio" id="n" name="yorn" value="No"&gt;
    &lt;label for="n"&gt;No&lt;/label&gt;&lt;br&gt;
    &lt;button&gt;Check Value&lt;/button&gt;
    &lt;p&gt;
  
    &lt;/p&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I'm trying to get the values of all the inputs in my form one by one. But I cannot get the radiobuttons values, they always return the same value:</p>
  <p>But it checkes if any of the choices of input is checked and always returns the first option (even if &quot;No&quot; is checked, the <code>input.val()</code> is &quot;Yes&quot;). How to make it work assuming I want to use <code>let input</code> variable as above not just <code>$('input:checked')</code> selector?</p>
  <p>Fiddle:
  <a href="https://jsfiddle.net/Malvinka87/0qdj6bLw/8/" rel="nofollow noreferrer">https://jsfiddle.net/Malvinka87/0qdj6bLw/8/</a></p>