193
rated 0 times
[
196]
[
3]
/ answers: 1 / hits: 26595
/ 9 Years ago, sat, october 24, 2015, 12:00:00
Why does this code throw an error in the console reading TypeError: pizzaBox.querySelector is not a function. (In 'pizzaBox.querySelector('h6')', 'pizzaBox.querySelector' is undefined)
?
function addToppingsToAll (toppings)
{
var pizzaBoxHolder = document.getElementById(PizzaBoxHolder);
var PizzaBoxList = pizzaBoxHolder.childNodes;
for ( var i = 0 ; i < pizzaBoxList.length ; i++ )
{
var pizzaBox = pizzaBoxList[i];
toppingList = pizzaBox.querySelector('h6');
toppingList.textContent = You have + toppings on your pizza;
}
}
More From » dom