JS倒计时执行操作
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> //换成你的jquery库 <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> var setTime; $(document).ready(function(){ var time=parseInt($("#time").text()); setTime=setInterval(function(){ if(time<=0){ clearInterval(setTime); return; } time--; $("#time").text(time); },1000); }); </script> </head> <body> <span id="time">60</span> </body> </html>