I have 2 java script functions. If the first one returns true, the 2nd one is not to be executed. If the first one returns false, only then the second function to be executed.
So I am trying to achieve this with the following code:

```
  <script type="text/javascript" language="javascript">   

     function needsForcedReset() {

           if($("#showMessage").text().length > 0) {
               return true;
           }
           return false;
     }

     function sendAlert() {
         //Sends an alert;
         alert('oh oh');
     }

     $(document).ready(function() {
        alert('in doc ready');
      if (needsForcedReset()) {
        alert('Need force reset, no check for alerts');
        return;
      }
      else {
        sendAlert();
     }

  });

  </script>

```

What I am seeing though, is that the sendAlert is being called regardless of what the needsForcedReset function return. How do I make it work?

**Edit: the showMessage is a div element**