16
mam trochę kodu JavaScript napisałem, iz jakiegoś powodu dostaję błąd mówiąc:Dlaczego otrzymuję komunikat "ReferenceError: getElementById nie jest zdefiniowany"?
ReferenceError: getElementById is not defined
Oto funkcja:
window.onload=function()
{
clearAll();
updatePizzaToppings();
updatePizzaToppings();
updatePizzaToppings();
updatePizzaToppings();
};
function updatePizzaToppings()
{
var checkBox=getElementById('selectBacon');
var pic=getElementById('BaconPic');
if (checkBox.checked)
{
pic.style.visibility='visible';
}
else
{
pic.style.visibility='hidden';
}
};
Zrobiłem trochę JSFiddle dla to także.