JSFiddle - React, Tailwind, and code Playground

HTML

<h3>Click this button</h3>

<button>Test</button>

<h3>Write something in those boxes</h3>
    
<input id="one">
    
<br><br>
    
<input id="two">

<br><br>
    
<input id="three">

<h3>Re-click the button</h3>

JavaScript

$("button").on("click", function(){
    $("#one").attr("value", "test");
    $("#two").prop("value", "test");
    $("#three").get(0).value = "test";
})