Teacher, if you write down your code silently, it won’t run all the time. It’s not easy to find bugs. Why can't I press Enter - PHP Chinese website Q&A - Teacher, if you write down your code silently, it won't run all the time. It's not easy to find bugs. Why can't I press Enter - PHP Chinese website Q&A
Teacher, if you write down your code silently, it won’t run all the time. It’s not easy to find bugs. Why can't I press Enter - PHP Chinese website Q&A - Teacher, if you write down your code silently, it won't run all the time. It's not easy to find bugs. Why can't I press Enter - PHP Chinese website Q&A
Take a look around and learn.
是代码里面node_body.firstChild影响的
用了回车的话,获取的是div元素下的第一个子节点,这时候这个子节点是一个文本节点,可以看下这篇文章javascript中的firstchild,调试的话,可以尝试像截图12行那样,输出查看下两次获取的imgObj对象有什么区别就能稍微看清楚点了