How to show/hide an image when value of an object changes between 1 and 0

How to show/hide an image when value of an object changes between 1 and 0

I have been learning jQuery from this forum and from Jake Cigar... Thanks a lot to Jake and this forum administrators....
And have been trying to design web-page to connect with PLC (which has a web-server in it), and control and monitor industrial processes... I need a little help... 

So i have been trying this method of showing a green image when motor is on, and showing a red image when motor is off... motor on and off are bool value, that is 1 and 0. So ProcessStatus is 1 when motor is on, and ProcessStatus is 0 when motor is off. When i display this using <label id="ProcessStatus">NA</label> I can see the value changing between 0 and 1 according to motor status. And I tried this below code 

-----------------------------------------------------------------------------------------
$('#ProcessStatus').text(data.ProcessStatus);
-----------------------------------------------------------------------------------------
var StatusP = ("#ProcessStatus");
if(StatusP == 1)
{
      $("#StopLight").hide();
      $("#StartLight").show();
}  
if(StatusP==0)
{
      $("#StopLight").show();
      $("#StartLight").hide();
}
------------------------------------------------------------------------------------------
where #StartLight and #StopLight are id for <img> to display green and red light images
-------------------------------------------------------------------------------------------

But it did not work... both the green and red lights were displayed...

Thank you.... much appreciate your time.....