<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
</head>
<body >
<form method="post" >
<input id="filter" style="width: 216px; height: 20px;"> <span onclick="clickMe(this)" title="крутой title">Нажми меня</span><br>
</form>
<script type="text/javascript">
var $filter = $('#filter');
function clickMe(el) {
$filter.val(el.title);
$filter.focus();
var e = jQuery.Event("keydown");
e.which= 13;
$filter.trigger(e);
}
$filter.keydown(function(e){
alert('Номер нажатой клавиши: ' + e.which)
});
</script>
</body>
</html>