I am trying to change background of div tag continuously using for loop and rgb() values . following is my code written in sample.html:
You can use .setInterval()
Enclose your code within a function called animate
animate
var intervalID = window.setInterval(animate, 500);
Not sure correct this
$("#sqr").css("background-color","rgb(" + r +"," +g+"," +b +")");