您还不是vip会员或者没有登录,无法进入学习,请登录后访问或者联系站长升级会员等级!
为了能给大家提供更好的服务和视频教程,本站VIP课程需要收取一定的学费,具体收费标准根据不同的班级课程和有效期长短有所不同,具体请咨询在线老师,多谢您对本站的支持!
js脚本教程43:使用js隐藏和显示html对象
实例1:隐藏和显示html对象
<p id="p1">零起点视频教程网</p>
<input type="button" value="隐藏v" onclick="$$(‘p1‘).style.visibility=‘hidden‘" />
<input type="button" value="显示v" onclick="$$(‘p1‘).style.visibility=‘visible‘" />
<input type="button" value="隐藏d" onclick="$$(‘p1‘).style.display=‘none‘" />
<input type="button" value="显示d" onclick="$$(‘p1‘).style.display=‘block‘" />
<input type="button" value="红色" onclick="$$(‘p1‘).style.color=‘red‘" />
<input type="button" value="蓝色" onclick="$$(‘p1‘).style.color=‘blue‘" />
<input type="button" value="移动" onclick="$$(‘p1‘).style.paddingLeft=‘200‘" />
<input type="button" value="返回" onclick="$$(‘p1‘).style.paddingLeft=‘0‘" />
<script type="text/javascript">
function $$(id){
return document.getElementById(id);
}
</script>
![]() |
豫公网安备 41010202002486号 | ICP备案:豫ICP备18044432号-1 |