1.在html中的注释:
在HTML里面写代码的注释就是这样的:

<!-- 这里是注释 -->

<!-- 这一个也是,
占了不止一行也可以。 -->

2.javascript中的注释:

第一种情况:注解整个html中的javcascript代码,
<!-- ... -->
它的顺序应 该为 <script> 先,接着为注解的开头 <!--,然後是内容,注解尾 -->, 最後是 </script>。
第二种情况:注解javascript代码中的一行,用//表示.注释多行为:/*这是注释多行代码*/ 
下面是一个完整的例子:
<html>
<head>
<script language="javaScript">
<!-- // hide  script from old brows
 /*-------------------------------------------------------------------------
  ---------------------------------------------------------------------------
*/
  function getname(str) {
    alert("哈罗! "+ str+"!");
  }
// end hiding contents
-->
</script>
</head>
<body>
Please enter your name:
<form>
  <input type="text" name="name" onBlur="getname(this.value)" value="">
</form>
</body>
</html>









3.asp中代码注释:
如果脚本是vbscript,就用'注释
如何脚本是javascript,就用//或者是/* */


 

相关文章:

  • 2021-11-04
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
  • 2022-12-23
  • 2021-11-22
猜你喜欢
  • 2021-11-20
  • 2021-12-06
  • 2022-12-23
  • 2021-11-03
  • 2021-03-31
  • 2021-06-01
相关资源
相似解决方案