非淡泊无以明志,非宁静无以致远 -心静如止水,动于静

javascript编码点滴20130419

1. 写css的时候,发现在同一个css文件中,以ID命名的css要比以class命名的css优先级高。如

<html>
<head>
<style>
  #high{
    background-color:red; 
    width:240px;
    height:300px;
  }
  .low{
    background-color:blue;
    width:240px;
    height:300px;

  }
</style>
</head>
<body>
  <div id="high" class="low">HELLO
  
  </div>
</body>
</html>

   虽然low写在后面,但启作用的是#high的定义

 

2. 用javascript提交表单。

 

<script type="text/javascript">

function TiJiao()
{
document.getElementById("BiaoDan").action="JieShou.php";
document.getElementById("BiaoDan").submit();
}

</script>

表单部分:

<form id="BiaoDan" name="BiaoDan" method="post">

 <input type="button" name="button" id="button" value="提交" onclick="TiJiao()" />
</form>

posted @ 2013-04-19 18:55  烟雨客  阅读(134)  评论(0编辑  收藏  举报