Edit in JSFiddle

<input type="radio" name="foo" data-url="//google.com"> гугл
<input type="radio" name="foo" data-url="//habr.com"> хабр
<hr>
<a href="//example.com" id="target">some link</a>

              
document.addEventListener('change', function(evt){
  if (evt.target.matches('[data-url]')) {
     target.href = evt.target.dataset.url
  }
})