<body>
      <p>Who will not qualify?</p>
      
      <form>
         <input type="button" value="FInd Out!" onclick="myFunction();" />
      </form>
      
   </body>
            function myFunction()
            {
               var winPoints = 3;
               var drawPoints = 1;
               
               try{
                  if ( drawPoints == 1 ){
                     throw( "Real Madrid will not qualify." ); 
                  }
                  
                  else
                  {
                     var qualification = winPoints + drawPoints;
                  }
               }
               
               catch ( e ) {
                  alert("Error: " + e );
               }
            }
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.