About interval

i created a button and a dynamic text box with variable “a” and here are my codes for the bottom:

a = 5;


function countdown(){
if(a > 0){

when i test it,the first time work all fine,the “a” decrease 1 every second,but the second time it just doesnt act how it suppose to be.is there something wrong with the interval?