Ver originalvar input = document.getElementsByName("titulo")[0] ; input.style.width = input.scrollWidth + "px"