I tried to write a script that increments a variable value, every time a button is clicked.

HTML Code:
  <script type="text/javascript">

  // if the count variable is undefined, set its value to zero
  if(! count) {
  var count = 0;

  // function to increment value of count variable
  incrementCount() {
  <!-- button to call incrementCount() function, on click -->
    <input type="button" value="Count"  onclick="incrementCount()">
  <br />
  <script type="text/javascript">
  // output count variable
Unfortunately the script is not working. Could you please tell me why?