JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://getfirebug.com/firebug-lite-debug.js"></script>


<input id="firstCheckbox" type="checkbox" name="test" checked="checked" />
<input id="secondCheckbox" type="checkbox" name="test" />

JavaScript

// mcpDESIGNS

var $test = $('input[name="test"]');

console.log( $test );
console.log( $(':checked', $test).attr('id') );

console.log( 'now with .selector: ');
console.log( $($test.selector + ':checked').attr('id') );