I would like to style the text content added to my page when I call document.write()
.
As you can see, I have a simple function to declare number between two dates however I don't know how to apply custom CSS styles to the number of days that I write to the document (ie via the diff
variable).
Any ideas, please?
Note: Changed the question a bit according to the comments.
function Cas420() {
var start = new Date("Febuary 1,2018 ");
end = new Date();
diff = 0;
days = 1000 * 60 * 60 * 24;
diff = end - start;
var dny = Math.floor(diff / days)
document.write(dny)
}
Cas420();