How could I get the value of an element via the attribute name instead of the ID. eg if I use by id it would be $(\'#id\').val();
name
ID
$(\'#id\').val();
Only one thing more: when you´re using the "crasis variable assignment" you need to use double cotes too AND you do not need to use the "input" word!:
valInput = $(`[name="${inputNameHere}"]`).val();