$(function(){ $("a").click(function(){ alert(1) $(".img").show(); setInterval("clock()",5000) }) funciton clock(){ $(".img").hide(); } })