JSFiddle - React, Tailwind, and code Playground

by Rainer Plumer

HTML

link 1 radio:<input type="radio" data-hash="link1" value="1"><br/>
link 2 radio:<input type="radio" data-hash="link2" value="2"><br/>
link 3 radio:<input type="radio" data-hash="link3" value="3"><br/>
    
    
<a href="javascript: handle_link_click('link1')">link 1</a><br/>
<a href="javascript: handle_link_click('link2')">link 2</a><br/>
<a href="javascript: handle_link_click('link3')">link 3</a><br/>

CSS

a {margin-top: 1em;}

JavaScript

window.handle_link_click = function( hash, evt) {
    //uncheck all radios and only check the matching radio
    $("input[type='radio']").prop("checked", false);
    $("input[data-hash='"+hash+"']").prop("checked", true);
    //and set url to your hash
    window.location.hash = "#"+hash;
}
//you can use data-hash ( or any other custom property) to link inputs with links.