Horje
setinterval on and off Code Example
Javascript stop setInterval
var myInterval = setInterval(function(){console.log("mmk")}, 2000);

clearInterval(myInterval); //stop that interval
javascript stop setinterval
let autoScroll = window.setInterval(() => {
  if (window.scrollY >= document.getElementById('second-part').scrollHeight) {

    clearInterval(autoScroll);
  }

  window.scrollBy(0, 10);
}, 25);
setinterval on and off
//setinterval on and off

h1 = document.querySelector("h1")
h2 = 0
document.querySelector("#onoff").value = "On"

function funi(){
  tr = setInterval(() =>h1.innerHTML = h2 ++, 1000)
  }

function onoff(){
  currentvalue = document.getElementById('onoff').value;
  if(currentvalue == "Off"){
  clearInterval(tr)
  document.getElementById("onoff").value="On";
  }else{
    funi()
    document.getElementById("onoff").value="Off";
  }
}




Javascript

Related
react native gridient button Code Example react native gridient button Code Example
escaping less than great than signs in react Code Example escaping less than great than signs in react Code Example
get each primary colour and add into an array javascript Code Example get each primary colour and add into an array javascript Code Example
jquery click ony works once on dropdown Code Example jquery click ony works once on dropdown Code Example
htmlfor jsx attr Code Example htmlfor jsx attr Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7