开发者

dynamic href using radio buttons

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜