Get name of form element

var name = element.getAttribute("name");

If you want a jQuery approach, you may use:

let elementName = $('#element_id').attr('name')

You can find more information about jQuery selectors here