Clear input field after click without attach any external script
I doubt it, that would be re-inventing the wheel IMO...what you're describing is pretty much what jQuery is for. Consider this code, which is a basic representation of what you're trying to do:

$(function() {
  $('#some-element').bind('someEvent', function() {
    $('#some-other-element').val('');
  });
});


That's only 3 meaningful lines of code, and is so trivial that writing a function to wrap around it would be counter-intuitive. The resulting code would end up being equally or more verbose, and all it would do is basically pass parameters blindly to a jQuery function.

Don't forget if you want to invoke any Javascript at all you're going to need an external JS file (or at the very least inline code). I would suggest using the above 3 lines in that external/inline JS would be preferable to using any sort of wrapper function (even if one does exist).