
    <b>Selected</b>
    <br />
    <div style="display: inline-block;">
        <pre>HP house: <span id=hp></span></pre>
        <pre>GoT house: <span id=got></span></pre>
    </div>

    <script>
        const hp = document.getElementsByName('hp');
        for (let i = 0; i < hp.length; ++i) {
            hp[i].addEventListener('change', function() {
                if (this.checked) {
                    document.getElementById('hp').innerHTML = this.value;
                }
            });
        }

  