var newwindow = window.open('something', 'newwindow', 'options'); newwindow.document.foo.attach1.value = 'Testing1';