开发者

HTML radio button, choose from another Button

开发者 https://www.devze.com 2023-03-28 22:45 出处:网络
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 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(); });

0

精彩评论

暂无评论...
验证码 换一张
取 消