What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-11 03:00:52
jquery time counter
<!-- Display the countdown timer in an element --> <p id="demo"></p> <script> // Set the date we're counting down to var countDownDate = new Date("Jan 5, 2022 15:37:25").getTime(); // Update the count down eve... Add solution -
Javascript 2022-02-01 04:21:44
refresh page after 10 mins of inactivity
If you want to refresh the page if there is no activity then you need to figure out how to define activity. Let's say we refresh the page every minute unless someone presses a key or moves the mouse. This uses jQuery for event binding: <script> ... Add solution -
Javascript 2022-01-23 04:51:00
js get current timestamp
var timestamp = new Date().getTime(); Add solution -
Javascript 2021-11-17 15:20:10
countdown in javascript
<!DOCTYPE HTML> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> p { text-align: center; font-size: 60px; margin-top: 0px; } </style> </head> <... Add solution -
Javascript 2021-11-13 14:43:09
javascript calculate time
// The getTime() method returns the number of milliseconds since midnight of January 1, 1970. var start = new Date().getTime(); for (i = 0; i < 50000; ++i) { // do something } var end = new Date().getTime(); var time = end - start; alert('Execution... Add solution -
Javascript 2021-11-09 19:23:16
submit form when countdown goes to zero
function Update() { var id = 'demo'; // Display ID for time left 'demo' var countDownDate = new Date('Dec 3, 2020 15:34:00').getTime(); var now = new Date().getTime(); var distance = countDownDate - now; if (distance > 0) { va... Add solution -
Javascript 2021-11-09 16:35:17
javascript get timestamp
var timestamp = new Date().getTime(); Add solution