<form> <input type="text" id="test" /> <input type="button" value="Set" onclick="document.getElementById('test').value='text'" /> </form>