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();
//name directly given var meetingDateFrom = $("input[name=MeetingDateFrom]").val(); //Handle name array var selectedValues = $('select[name="Roles[]"] option:selected').map(function() { arr.push(this.value); });