<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>控制DIV高度</title>
<style type="text/css">
#wrap
{width:200px;height:1px;overflow:hidden;border:1px solid green;}

</style>

</head>

<body>
<input type="button" value="显示" onclick="display()" />
<div id="wrap">

<input type="text"  value="werp"/>
</div>
<script type="text/javascript">
var i=0;
function display()
{
    
var wrap=document.getElementById("wrap");
    
if(i==0)
    {
        wrap.style.height
=0;
        i
=1;
    }
else
    {
        wrap.style.height
=100;
        i
=0;
    }
}

</script>
</body>
</html>

相关文章:

  • 2022-02-04
  • 2021-12-28
  • 2021-10-18
  • 2021-12-27
  • 2021-09-05
  • 2021-12-23
猜你喜欢
  • 2021-11-24
  • 2022-12-23
  • 2022-02-09
  • 2022-01-22
  • 2022-12-23
相关资源
相似解决方案