Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

Recent questions tagged 当for循环里有名为onclick函数时,window会被加上点击事件

0 votes
620 views
1 answer
    <script type="text/javascript"> for (var i = 0; i < 3; i++) { function onclick(e) { document.write(222) } } </script> 点这里测试 如上代码,会被加上点击事件,莫名奇妙 而且将onclick不放在for循环里时,并没有这个现象...
asked Jan 29, 2021 in Technique[技术] by 深蓝 (71.8m points)
To see more, click for the full list of questions or popular tags.
Ask a question:
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...