先来看这样一个代码,给a_left添加事件监听器
但是报错了:a_left.addEventListener is not a function
问题很大,因为我们获取过来的a_left是一个数组,没办法直接添加事件监听器。
这时候就需要先遍历数组,给每一个数组里的元素添加事件监听器。
这样就解决了 .addEventListener is not a function的问题
先来看这样一个代码,给a_left添加事件监听器
但是报错了:a_left.addEventListener is not a function
问题很大,因为我们获取过来的a_left是一个数组,没办法直接添加事件监听器。
这时候就需要先遍历数组,给每一个数组里的元素添加事件监听器。
这样就解决了 .addEventListener is not a function的问题