Answer the question
In order to leave comments, you need to log in
How to implement this in html?
I often saw on sites how the text changes, as if it were an animation, for example, in the form of a countdown. How to implement it and what is it generally called?
In the comments I will throw a link to the page, as an example, where it is.
Answer the question
In order to leave comments, you need to log in
This can be done via JavaScript. You create a method where the time will change every second (google for help).
Let's say we change the text in the paragraph:
We need Id in JavaScript:
Create a script tag and inside do this thing:
<p id="timer1">00:00:00</p>
document.getElementById("timer1").innerHTML = "00:00:01";
document.getElementById("timer1").innerHTML = hour + ":" + minute + ":" + seconds;
или это:
var dv = ":";
document.getElementById("timer1").innerHTML = hour + dv + minute + dv + seconds;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question