javascript input by name code example
Example 1: select input by name javascript
var element = document.querySelector("form[name='second'] input[name='secondText']");
Example 2: how to get input name in javascript
// Using jQuery:
$('#id').attr('name');
// Using vanilla js:
let name=document.getElementById("id").name;