标签:
if条件使用的第一种情况
if(条件){
}
当字号小于26时,可以不停增加字号;当字号大于13时,可以不停减小字号。到26号时,不能增加,到13号时,不能减小。
<!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>无标题文档</title>
	  <style type="text/css">
		    p{
			      width:400px;
		     }
	  </style>
	  <script type="text/javascript">
		    window.onload=function (){
			      var oInp1=document.getElementById("inp1");
			      var oInp2=document.getElementById("inp2");
			      var oP=document.getElementById("p1");
var num=20;
			      oInp1.onclick=function (){
				        if (num>13){
					          num --;
					          oP.style.fontSize=num+"px";
					          alert(num);
				        }
				
			       }
			       oInp2.onclick=function (){
				          if (num<26){
					          num ++;
					          oP.style.fontSize=num+"px";
					          alert(num);
				        }
				
			      }
		  }
	  </script>
</head>
<body>
  <input id="inp1" type="button" value="-" />
  <input id="inp2" type="button" value="+" />
  <p id="p1">返回的是链接到点石网站,却没有链接到我的博客的网站。使用这个指令可以找到很多连向你
  的竞争对手或其他同行业网站,却没连向你的网站的页面,这些网站是最好的链接资源。
  高级搜索指令组合使用变化多端,功能强大。一个合格的SEO必须熟练掌握这几个常用指令的
  意义及组合方法,才能更有效率地找到更多竞争对手和链接资源。</p>
</body>
</html>
标签:
原文地址:http://www.cnblogs.com/yddwang/p/5601832.html