Jak uzyskać obiekt wejściowy w JS po nazwie

var element = document.querySelector("form[name='second'] input[name='secondText']");
Joyous Jellyfish