Auto Expire | JavaScriptSource

Auto Expire

Don Demrow Aug 11, 2008


Set "go live" and "expire" dates for content, such as "Latest News" or various promotional content. Great for when you don't have time to remember to go back and take old content down, or when you want to create content and have it go live at a later date.


Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: autoExpire.js


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document

Leave a Response


Hi. I'm looking for a script or an HTML code where I can write multiple bits of data to be visible on a webpage, but to have the control to have each bit of information expire/disappear independently. I've tried your Expire Javascript, and it works great, if I only have one item to Display and Expire. Here's what I'm looking for. It's for a calendar page, that will basically show detailed information for each of the upcoming events, but as the days go by and the events come and go, I need those particular bits of information to vanish from sight, while not removing the other bits of information for events that have not taken place yet. Is there a way that I can setup code and add entries to either the HTML page or a .js file, where all the content can be seen until each one expires separately? I hope I'm being clear enough. Thank you for your time.

JP Feb 25, 2017

Javascript is good

johnsantosx Apr 25, 2013