我使用jsfiddle运行它,源代码是http://jsfiddle.net/eVyjC/12/一
I want to add a button to start and stop number changing. I use a div containing six spans, each has a number.
Then I use createElement to create a input button and set onclick to run the user-defined function setInterval(keepMove) but it doesn t work and no any error come out?
And then I test by use alert, to my surprise it run when load the page without click the button?
我的问题是:
1.为什么加载时onclick会先运行,以及如何按照我的期望单击按钮让它运行?
2.我试图在最后一个跨度中添加一个br,将按钮移动到下一行,但不起作用。我做错了什么,该如何修复?
感谢您阅读我的问题,我几天来一直在努力解决这个问题,并尝试了许多方法,但都不起作用。(例如document.write html标签或createElement和Childappend)