1、html代码:
click me!
2、js代码:
var index=0;function demo(){ var colorArr=['red','yellow','blue']; event.target.style.backgroundColor = colorArr[index%3]; index+=1;}