jquery - fire a event once the variable data chnages in JQ -


i want fire event once value of varible changes. using js or jq not angular. me out. test.

function starttime() {    var date = new date();    seconds = date.getseconds();    document.getelementbyid('test').innerhtml = seconds;  }  $(document).ready(function() {    starttime();    window.setinterval(function() {      starttime();    }, 500);  });
#test {    padding 50px 50px 50px50px;  }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <div id='test'>    </div>

help me out on each change of seconds value.

got answer now. cant it. have call function. :(

edit way create new loop same speed variable change. of here 1 second. made loop 1 sec interval , executed function there. , in angular js availble please check tutorial hope clear now. if wrong., please correct me. thanks.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -