Is it possible, using jQuery, to fire off an event to set a div tag's text after n. seconds?
Thanks! George
jQuery delay() Method The delay() method sets a timer to delay the execution of the next item in the queue.
Timing events are the events that help to execute a piece of code at a specific time interval. These events are directly available in the HTML DOM (Document Object Model) Window object, i.e., they are present in the browser.
timeStamp is an inbuilt property in jQuery which is used to measure difference in milliseconds between the time of event created by the browser and January 1, 1970.
var doIt = function() {
$("div.my").text("My message");
}
setTimeout(doIt, 3000);
if you're using jQuery 1.4, you can always do:
$(function() {
$('#divId').delay(3000).text('New Text');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With