If you want to write javascript function code directly in the onclick event handler declaration instead of using a separate function for that code, you can do it as follows:
<input type="button" value="Save" onclick="javascript:(function(){ //your code; })();"/>