开发者

dynamic href using radio buttons

开发者 https://www.devze.com 2022-12-27 06:29 出处:网络
Is there a way to create a dynamic hre开发者_开发技巧f using radio buttons? radio = value1 radio = value2

Is there a way to create a dynamic hre开发者_开发技巧f using radio buttons?

radio = value1
radio = value2
radio = value3

<a href="test.php?value=radio">


I wonder what are you trying to do, however you can:

$(function(){
  $('input[type="radio"]').click(function(){
    if ($(this).is(':checked'))
    {
       $('a').attr('href', 'test.php?value' + $(this).val()).text($(this).val()).appendTo($('body'));
    }
  });
});
0

精彩评论

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