Код: Выделить всё
function show() {
document.getElementById('box').style.display = "block";
}< /code>
[url=javascript:show();]Show[/url]
Lorem Ipsum
Но теперь, когда я просто изменяю div из идентификатора на класс и заменить GetElementById
, он больше не работает:
Код: Выделить всё
function show() {
document.getElementByClassName('box').style.display = "block";
}< /code>
[url=javascript:show();]Show[/url]
Lorem Ipsum
Что я делаю не так?
Подробнее здесь: https://stackoverflow.com/questions/251 ... yclassname
Мобильная версия