JSFiddle - React, Tailwind, and code Playground

HTML

<input id="hi" type="text" value="hello" />

JavaScript

document.getElementById("hi").setAttribute("value","what");