45
rated 0 times
[
48]
[
3]
/ answers: 1 / hits: 43978
/ 8 Years ago, tue, june 7, 2016, 12:00:00
<div id=par>
<span id=a1></span>
<span id=a2></span>
<div id=par2>
<span id=a3></span>
<span id=a4></span>
</div>
</div>
<script>
var ele = document.querySelectorAll('#par span');
for( var p of ele ){
console.log(p);
}
</script>
When i run this code I see error
Uncaught TypeError: ele[Symbol.iterator] is not a function
How to fix this problem ?
More From » ecmascript-6