<head>
<title>display隐藏文字</title>
<style>
.CSS6{
background: #0067cb;
color: #fff;
width: 175px;
height: 42px;
border-radius: 42px;
line-height: 42px;
font-size: 16px;
cursor: pointer;
}
</style>
<script>
function show_div(){
var obj=document.getElementById('test_div');
var btn=document.getElementById('show_btn');
if(obj.style.display=='none'){
obj.style.display='block';
btn.style.display='none';
}
}
</script>
<button id='show_btn' onclick="show_div()" class="CSS6" >点击展开全文</button>
<div id='test_div' style = "display :none ">这里是测试用的div</div>
</body>
</html>
display隐藏文字 - 截取文章内容
最新推荐文章于 2024-10-14 16:05:05 发布