Public code

IE11でquerySelectorAllで取得したNodeListをforEachするとエラーになるのを回避する書き方

0
0
Screenshot!
Copy Code!
var nodelist = document.querySelectorAll('.js-get_listItems'); var node = Array.prototype.slice.call(nodelist,0); node.forEach(function(elem, index){ elem.textContent = "アイテム" + index; });
Back to Home