num is a variable which is dynamically changed within 1 to 9.
I must update the value in HTML for example let say the num is 6,
i need to set 1st field as 6, second field as 7, third field as 8 and so on
in simple version, 6, 7, 8, 9, 1, 2, 3, 4, 5
$("#one").text(num);
....
$("#nine").text(num+8);
EDIT: Sorry for confusion
$("#one").text(num);
$("#two").text(num+1);
....
$("#nine").text(num+8);
so for example, the value on $("#nine") is 6+8 = 14, whereas it should be 5
You’re looking for the modulus operator,
%In this case, something like: