Display message to every minute in Javascript
Topics related to client-side programming language.
Post questions and answers about JavaScript, Ajax, or jQuery codes and scripts.
-
JanMolendijk
- Posts: 267
- Location: Holland Rotterdam
Display message to every minute in Javascript
Hello,
On eatch minute from the current hour I wanna have an message
I can not find out how to complete
Code: Select all
I hope to get something like this (code not working)
<script>
var day = new Date();
let hr = day.getHours();
let mn = day.getMinutes();
let se = day.getSeconds();
let st_hm = +hr.+mn;
if (st_hm == 7.40) document.write("40 <br>55555555 Geld moet Rollen")
if (st_hm == 7.41) document.write("41 <br>55555555 Geld moet Rollen")
if (st_hm == 7.42) document.write("42 <br>55555555 Geld moet Rollen")
if (st_hm == 7.43) document.write("43 <br>55555555 Geld moet Rollen")
if (st_hm == 7.44) document.write("44 <br>55555555 Geld moet Rollen")
</script>
this example give an messange on eatch differen minte
Code: Select all
<SCRIPT LANGUAGE="JavaScript">
day = new Date()
hr = day.getHours()
mn = day.getMinutes()
se = day.getSeconds()
if (mn == 1) document.write("<br>1 <br>")
if (mn == 2) document.write("<br>2 <br>")
if (mn == 3) document.write("<br>3 <br>")
if (mn == 4) document.write("<br>4 <br>")
if (mn == 5) document.write("<br>5 <br>")
</script>
this example give an messange on eatch differen second
Code: Select all
<SCRIPT LANGUAGE="JavaScript">
day = new Date()
hr = day.getHours()
mn = day.getMinutes()
se = day.getSeconds()
if (se == 1) document.write("<br>1 Wat gaat er gebeuren ?")
if (se == 2) document.write("<br>2 Draag zorg voor voorraad")
if (se == 3) document.write("<br>3 Geld moet Rollen")
if (se == 4) document.write("4 <br> Geld moet Rollen")
if (se == 5) document.write("5 <br> Geld moet Rollen")
</script>
MarPlo
If you only want to display a message to every minute, just use the setInterval() function. It calls a function repeatedly, over and over again, at specified time intervals.
See the following tutorial:
coursesweb.net/javascript/settimeout-setinterval_t
Similar Topics
-
Javascript add different text to each minute of hour
JavaScript - jQuery - Ajax
First post
Hello Coursesweb I`m unknown with javascripts ????
I would like to add function minutes to this script
on each minute an diferent text added to...
Last post
Hello,
Try the following script.
<div id='addtxtmin' style='color:#00d; font-size:20px; font-weight:700'></div>
<script>
const...
-
One Minute Wisdom
Spirituality
First post
One Minute Wisdom is a book written by Anthony de Mello with various anecdotes and short religious and spiritual stories.
- You can download and...
Last post
Attachment
- I have no idea of what tomorrow will bring, so I wish to prepare for it.
- You fear tomorrow; --not realizing that yesterday is just...
-
Display selected option into a Div
JavaScript - jQuery - Ajax
First post
How can I make that when an option from dropdowna <select> list is selected, the value of that option be displayed into a Div.
I have this...
Last post
You have to start with a <select> element which raises a 'change' event when an option is selected.
Inside that event, 'this.value' refers to...
-
Spatial Reality Display: Responsive, no-glasses 3D
Entertainment and Games
Sony has debuted a new kind of 3D monitor with its Spatial Reality Display, which tracks your eyes and shows a different dynamically-generated image...
-
How to get text from javascript alert box
JavaScript - jQuery - Ajax
First post
Good evening (dutch-time) I have a javascript what can copy text to a clip-board + it has a button to show the item-list in a alert-box.
But can`t...
Last post
Thanks for the support I tried already things with history + f_print
also studied those a little before I asked coursesweb but I shall
when my head...