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'));
}
});
});
精彩评论