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();
Use the name attribute selector:
$("input[name=nameGoesHere]").val();
2.1m questions
2.1m answers
60 comments
57.0k users