JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE html>
<html>
<body>

Select your favorite fruit:
<input type="text" id="id123">

<p>Click the button to change the text for the apple option in the dropdown list.</p>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
    document.getElementById("id123").select();
}
</script>

</body>
</html>