버튼을 클릭하면 같은 페이지내 다른 내용을 표시해주는 소스이다.
의외로 매우 간단하다.
[자바스크립]
<script language="javascript">
function btnShow(find) {
document.all.find.style.display = "none";
document.all.find2.style.display = "none";
var obj = eval("document.all." + find);
obj.style.display = "block";
}
</script>
==========================================
[html]
<a href="javascript:btnShow('find')" ><input type="button" value="버튼명"></a>
<a href="javascript:btnShow('find2')" ><input type="button" value="버튼명"></a>
<div id="find" style="display:none;">
나타낼 내용 작성 1
</div>
<div id="find2" style="display:none;">
나타낼 내용 작성 1222
</div>
'개발 > PHP' 카테고리의 다른 글
ajax - json을 이용한 아작스 간단예제 (0) | 2017.08.16 |
---|---|
[html/php] 한페이지내 텝메뉴를 통한 구현 (0) | 2017.05.01 |
input 동적 추가/삭제 하기 (0) | 2016.11.08 |
데이터 파싱 서버에서 off 일경우 // 데이터 파싱이 안될때 (0) | 2016.11.04 |
php 숫자 앞에 0 을 붙일때, sprintf 쓰자! (0) | 2016.11.03 |