• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 411
  • Last Modified:

clear div 5 seconds after ajax returns value

I am trying to figure out how I can make a div clear all of its information about 5 seconds after it appears..I am running an ajax script and I just want the information it returns to appear for a few seconds then dissapear.
0
brad0525
Asked:
brad0525
  • 2
1 Solution
 
leakim971PluritechnicianCommented:
in your callback function (where you get the answer of your call) use setTimeout : http://www.w3schools.com/jsref/met_win_settimeout.asp

setTimeout("document.getElementById('mydiv').innerHTML = ''",5000);
0
 
amrish80Commented:
Hi
Use the time out function after the Ajax call...
0
 
brad0525Author Commented:
Thank for the example
0
 
leakim971PluritechnicianCommented:
You're welcome! Thanks for the points!
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now