Problem with IF statement

Problem with IF statement

This is the first if/else statement i've written in javascript and I've been banging my head on this for a few hours and I can't seem to solve this. It's seems like it should be very straight forward.

The functionality i'm trying to achieve is a captions overlay on images only if they have a description in the alt attribute of the image.


function hideCaption() {
   
    var hideCaption = find('img').attr('alt').length;
   
      if(hideCaption.length==0;){
          $('#slideshow-caption').css("display", "none");
      }
      else{
          $('#slideshow-caption').css("display", "inline");
      }
}