select input by name javascript

JavaScript
//Get all the elements
document.getElementsByName("name");

//Get the first element
document.getElementsByName("name")[0];var element = document.querySelector("form[name='second'] input[name='secondText']");
Source

Also in JavaScript: