标签:function inter interval doctype xmlns document set int script
<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/html"> <head> <meta charset="UTF-8"> <title>Title</title> <script>
var num = 1 ; function change() { num++; if(num > 3) { num =1; } var p1 = document.getElementById("p1"); p1.src=""+num+".jpg"; } setInterval(change,2000)
</script> </head> <body> <img src="1.jpg" id="p1">
</body> </html>
标签:function inter interval doctype xmlns document set int script
原文地址:https://www.cnblogs.com/xinglingzhiren/p/11146102.html