Янковиц,
как вариант для медитации
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
var input;
$('input[name="test"]').on('blur', function(event) {
input = this;
});
$('span').on('click', function() {
input && (input.focus(),input.value += this.textContent);
});
});
</script>
</head>
<body>
<input id="1" type="text" name="test" class="name" />
<input id="2" type="text" name="test" class="name" />
<span>100</span>
<span>200</span>
</body>
</html>