Reputation: 3
I'm having trouble passing a variable in the following
var whichRbClicked = $('input:radio[name=RBname]:checked').val();
where RBname is the variable.
Any help or advise would be MUCH appreciated. TIA
Upvotes: 0
Views: 1167
Reputation: 382816
Should be:
var whichRbClicked = $('input:radio[name=' + RBname + ']:checked').val();
For more info, check out:
Upvotes: 2