반응형 2023/0228 jquery time count text 시간단위로 표시 var count = 0; var intervalId = setInterval(function(){ count++; var minutes = Math.floor(count / 60); var seconds = count % 60; $("#timer").text(minutes + ":" + (seconds < 10 ? "0" + seconds : seconds)); }, 1000); 2023. 2. 8. jquery timer 종료 var intervalId = setInterval(function(){ // Timer logic }, 1000); // To stop the timer: clearInterval(intervalId); 2023. 2. 8. jquery 현재시간 setInterval(function(){ var currentTime = new Date(); var hours = currentTime.getHours(); var minutes = currentTime.getMinutes(); var seconds = currentTime.getSeconds(); $("#currentTime").text(hours + ":" + minutes + ":" + seconds); }, 1000); 2023. 2. 8. jquery array 변수 선언 var myArray = ["apple", "banana", "cherry"]; console.log(myArray[0]); // Output: "apple" var myArray = ["apple", "banana", "cherry"]; $("#showArray").click(function(){ $("#arrayDisplay").text(myArray); }); 2023. 2. 8. 이전 1 ··· 3 4 5 6 7 다음 반응형