$(function () {
$("#MyInputBox").keyup(function () {
var nextChk = $(this).next(":radio:checked").attr('id'));
alert(nextChk);
});
});
What is the correct way to say “Get the ID of the next checkbox which is checked” Am I even close?
Assuming your radio inputs are all siblings, you’d need to use
.nextAll(), and then narrow down to the first match.or
Or you could technically use
.nextUntil()with.next().Also, I see that you’re asking about checkboxes, but your code uses
:radio, so I guess I don’t know which one you actually want.