JSFiddle - React, Tailwind, and code Playground

HTML

<p id="address">URL: <span></span></p>

<label>Edit the hash value for this frame:
    <input type="text" size="40" value="<script>alert(1)</script>" />
</label>

<br/><br/>

<select>
    <option value="An <b>innocent</b> string">Innocent String 1</option>
  <option value="Another <b>innocent</b> string">Innocent String 2</option>
    <option value="Yet another <b>innocent</b> string">Innocent String 3</option>
    <option id="guilty" value="<script>alert(1)</script>">Not So Innocent String</option>
</select>

<div></div>

JavaScript

addString();
updateHash();
$("select").change(addString);
$("input").keyup(updateHash);

function addString() {
    var displ=$("select").val()+"<br/>";
	$("div").append(displ);
}

function updateHash() {
    window.location.hash = $("input").val();
    $("#guilty").val(window.location.hash);
    $("p#address span").text(window.location);
}