<div id="root"></div>
function App() {
  const [value, setValue] = React.useState("");

  return (
    <>
      input: 
      <label>
        <input
          type="radio"
          id="a"
          value="a"
          name="test"
          onChange={(e) => setValue(e.target.value)}
        />
        a
      </label>
      <label>
        <input
          type="radio"
          id="b"
          value="b"
          name="test"
          onChange={(e) => setValue(e.target.value)}
        />
        b
      </label>

      <div>state: {value}</div>

      <a href='javascript:(function(){document.getElementById("a").click()})();'>
        Bookmarklet
      </a>
    </>
  );
};

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<App />);
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js