$('a[href^="#"]').click(function (e) {
e.preventDefault();
elementClick = $(this).attr("href");
destination = $(elementClick).offset().top;
$('html, body').animate( { scrollTop: destination }, 1000 );
});
var onInputFunc = (function(e) {
if (e.keyCode == 13) {
$('a').trigger('click');
}
});
$('input').on("keydown", onInputFunc);
$('a').click(function() {
alert('click on a');
});