user_i,
 Вариант ...
<!DOCTYPE html>
<html >
<head>
  <title></title>
</head>
<body>
<input type="button" name="go" value="go" id="button" />
<script type="text/javascript">
 function doSomething(a) {
   return function ()
 {
  alert(a)
 }
  }
document.getElementById('button').onclick = doSomething('Спасибо')
</script>
</body>
</html>