Javascript timer to close

javascript

I have the following code that closes an iframe footer pop-up I have.

<a href="javascript:void(0)" onclick="parent.adpHide('footer')" class='close'>
<img alt='' src="images/close.png" /></a>

That works fine, what I'm wanting though is to set a timer that after 5 seconds closes footer.
Any suggestions?

Best Answer

setTimeout(function() { parent.adpHide('footer') }, 5000)