document.querySelector('#test').value='Text'; setTimeout(function(){ document.querySelector('#test').click(); },5000);