HTML radio button, choose from another Button
I need to select a radio button from a href link. I have 4 different packages for users to choose from and they are listed on the radio button.
I have an image for each package, now I want the related radio button to be selected when the user clicks the related image link.
So for e.g. User clicks Image 2 and the radio button is on option 2, 3 for 3, 4 f开发者_开发问答or 4, etc.
Any direction would help.
Try using Javascript. This will probably be the easiest solution to your problem.
$('#img1').click(function() { $('#radio1').attr('checked', 'checked'); });
or
$('#img1').click(function() { $('#radio1').click(); });
精彩评论