Hej,
Załóżmy że mamy 6 divów, max-height w każdym z nich jest ustawiony na 0px.
Pod każdy z tych divów ustawiony jest button z onclickiem na 6 funkcji.
Chciałbym zrobić tak żeby po kliknięciu wybranego buttona pojawił się przypisany do niego div.
Udało mi się to zrobić tylko za pomocą
getElementByID("div1").style.maxHeight = " 2000px",
getElementByID("div2").style.maxHeight = " 0px",
getElementByID("div3").style.maxHeight = " 0px" etc..
Próbowałem to zrobić zaprzęgając do tego getElementByClass() oraz getElementByID()... tj.
getElementByClass("hidediv").style.maxHeight = " 0px"
getElementByID("div1").style.maxHeight = " 2000px".
hivediv jest przypisany do każdego diva oczywiście, jednak coś nie idzie.
Ktoś coś?