电脑爱好者,提供IT资讯信息及各类编程知识文章介绍,欢迎大家来本站学习电脑知识。 最近更新 | 联系我们 RSS订阅本站最新文章
电脑爱好者
站内搜索: 
当前位置:首页>> Javascript>>jquery入门实例:隐藏html标签:

jquery入门实例:隐藏html标签

来源:网络 | 2013-9-3 | (有2436人读过)

复制下面代码,保存为1.html

运行后,点文本看下效果。文本会自动隐藏。

<html> 
<head> 
<script type="text/javascript" src="jquery.js"></script> 
<script type="text/javascript"> 
$(document).ready(function(){ 
  $("p").click(function(){ 
  $(this).hide(); 
  }); 
}); 
</script> 
</head> 

<body> 
<p>If you click on me, I will disappear.</p> 
</body> 

</html> 
Javascript热门文章排行
网站赞助商
购买此位置

 

关于我们 | 网站地图 | 文档一览 | 友情链接| 联系我们

Copyright © 2003-2024 电脑爱好者 版权所有 备案号:鲁ICP备09059398号