how to stop the setinterval() in javascript

Posted by vakas on Stack Overflow See other posts from Stack Overflow or by vakas
Published on 2010-04-15T08:19:27Z Indexed on 2010/04/15 8:23 UTC
Read the original article Hit count: 239

Filed under:

i want to stop the setinterval at a specific condtion

i am using this

 function Blink(targetId)
 {
     if($(targetId))
      {
         if($(targetId).style.color=='red')
         $(targetId).style.color='black';
         else
          $(targetId).style.color='red';
       }
       else
//STOP THE FUNCTION
   }

setInterval(Blink,1000,'timer_'+sourceId);

© Stack Overflow or respective owner

Related posts about JavaScript