Ben Ben - 1 year ago 61
Javascript Question

Replacing a <DIV> after a set time

I'm trying to replace DIV-A with DIV-B on a landing page after 10 seconds.

I've been looking round and JQUERY seems to be the best bet, but I'm not sure how to do it. There seems to be plenty of solutions for cycling DIVs, or replacing one on a button click, but I just need the first to be replaced by the second.

If there's any other easy solutions I'm open for anything. The site is HTML and I'm already using the minified JQUERY for something else.

Answer Source



  <script type='text/javascript' src='js/jquery-1.5.1.min.js'></script> 

  <script type='text/javascript'> 





  <div id="Div-A">BOOOOOO</div> 
<div id="Div-B" style="display:none;">YAAAAAA</div> 


Here is a working demo

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download