태그 위의 표시/숨기기 버튼을 클릭하면 정상적으로 작동합니다. 그러나 그 아래의 버튼 (앞면 가득 차 있음)은 태그의 내용을 숨기지 않습니다. 시작 태그 위의 버튼을 움직이면 작동합니다. 어떻게 위의 숨기기 태그에 연결할 수 있습니까?버튼을 클릭 한 후 설정 "표시 : 없음"
<input type="button" onclick="show(this);" value="show"/>
<input type="button" onclick="hide(this);" value="hide"/>
<hide class="inner" style="display.none;">
<input type="button" onclick="showSpoiler1(this);" value="Front flip variaion (ramp)" />
<input type="button" onclick="showSpoiler2(this);" value="Front flip variaion (flat)" />
<input type="button" onclick="showSpoiler3(this);" value="Backflip variations" />
<input type="button" onclick="showSpoiler4(this);" value="Sideflip Variations (ramp)" />
<input type="button" onclick="showSpoiler5(this);" value="Twists and other tricks" />
<div1 class="inner" style="display:none;">
<ul>
<input type="button" onclick="hide(this);" value="Front full"/>
<li>Double Front</li>
<li>Aerial Twist</li>
</ul>
</div1>
</hide>
JS
function show(obj)
{
var inner = obj.parentNode.getElementsByTagName("hide")[0];
inner.style.display = "";
}
function hide(obj)
{
var inner = obj.parentNode.getElementsByTagName("hide")[0];
inner.style.display = "none";
}
사이드 노트'에 오타 <숨기기 클래스 = "내부"스타일 = "display.none;"> '자신 만의 요소를 구성하는 것은 일반적으로 브라우저 호환성 측면에서 나쁜 생각이다. – j08691
JS 답변이나 jquery에 대해 더 알고 싶습니까? –