레이어 펼치기 닫기 입니다. 채택완료
따라하기
9년 전
조회 5,946
아래의 코드는 레이어 펼치기 닫기 입니다.
그런데, 제가 필요한건.. 내용이 나타난 상태 에서는 '바꿔줘야할 내용' 을 '바뀜' 이라는 글씨로 바꿔주는것 입니다.
$("#show_hide").text("바뀜"); <----- 이거 안되구요.
obj.innerTEXT = "바뀜"; <----- 이것도 안됩니다.
방법이 뭔가요?
</p><p><script language="javascript" type="text/javascript"></p><p>function toggle(item) {
obj = document.getElementById(item);
visible = (obj.style.display != "none");
if(visible){
obj.style.display = "none";
} else {
obj.style.display = "block";
}
}</p><p></script></p><p> </p><p><div id="hideThis">
<table>
content..
</table>
</div></p><p> </p><p><script>toggle('hideThis');</script></p><p><a href="#" id="show_hide" onclick="javascript:toggle('hideThis');">바꿔줘야할 내용</a></p><p>
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인