I want to be add the following to a a page:
When a div is clicked, I want to:
You could use the setTimeout function:
$('div.highlightable').click(function(){
var $this = $(this);
//change background color via CSS class
$this.addClass('highlighted');
// set a timeout that will revert back class after 5 seconds:
window.setTimeout(function() {
$this.removeClass('highlighted');
}, 5 * 1000);
});