본문 바로가기

프로그래밍/WEB,CSS,HTML5

CSS DIV 이미지 보이기 감추기


function imgview(){
    {
  var test = document.getElementById('test'); test.style.display = 'inline';
 }
}

function imghide(){
    {
  var test = document.getElementById('test'); test.style.display = 'none';
 }
}

.........................................................................................................................................................................................

 

<div style = 'width:240px; height: 100px; background-color:yellow'>
    <input type = "button" value="view" onclick="imgview()" />
    <input type = "button" value="hide" onclick="imghide()" />
 <p><img src="test.jpg" width="250" height="225" alt="test" style="display:inline;" id="test" /></p>
</div>



하지만 이제 jquery를 많이 사용 하겠지..

'프로그래밍 > WEB,CSS,HTML5' 카테고리의 다른 글

SW 개발자, “HTML5가 대세”  (0) 2013.03.01
div와 span태크  (0) 2013.03.01
Input박스 안에 글쓰기  (0) 2013.03.01
구글맵 fitBounds  (0) 2013.03.01
유용한 div 레이아웃 템플릿 사이트  (0) 2013.02.27