innerHTML의 활용

7768 단어 innerHTML
<!doctype html>

<html>



<style>

li{float:left;margin:0 100px;color:red;}



</style>

<head>

</head>

<body>

<div id="show" style="widht:100%;height:50px;background:#000;color:#fff;text-align:center;line-height:50px;font-size:50px;"></div>

<div style="width:100%;height:20px;background:#000;">

<ul style="list-style:none;">

<li>  </li>

<li>    </li>

<li>l </li>

<li>=  =</li>

<li>   </li>

<li>  </li>

</ul>

</div>





<script>

window.onload=function(){

var Oshow = document.getElementById('show');

var Oli = document.getElementsByTagName('li');

for(var i =0;i<Oli.length;i++){

Oli[i].onmouseover=function(){

Oshow.innerHTML= this.innerHTML

}

}

}



</script>

</body>

</html>

  

좋은 웹페이지 즐겨찾기