JSFiddle - React, Tailwind, and code Playground

by rodrigonery

HTML

<input id="teste" type="text"/>

JavaScript

function updateInput(val) {
    document.getElementById('teste').value = val + 'km';
}

updateInput('20');