try
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("body").on("change", "input[name='TestName1'],input[name='TestName2']", function (a, b) {
var name = a.target.name;
alert(name);
});
});
</script>
</head>
<body>
<input type="text" name="TestName1" value=" " />
<input type="text" name="TestName2" value=" " />
</body>
</html>