javascript一段时间代码
<SCRIPT language=javaScript>
<!--
now = new Date(),hour = now.getHours()
if(hour < 6){document.write("凌晨好!")}
else if (hour < 9){document.write("早上好!")}
else if (hour < 12){document.write("上午好!")}
else if (hour < 14){document.write("中午好!")}
else if (hour < 17){document.write("下午好!")}
else if (hour < 19){document.write("傍晚好!")}
else if (hour < 22){document.write("晚上好!")}
else {document.write("夜里好!")}
// -->
</SCRIPT>
今天是
<SCRIPT language=JavaScript><!--
var dayNames = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
Stamp = new Date();
document.write("" + Stamp.getYear() + "年"+(Stamp.getMonth() + 1) +"月"+Stamp.getDate()+ "日"+ "");
//--></SCRIPT>
相关文档:
删除行
<script>
function del(obj)
{
obj.parentNode.parentNode.removeNode(true);
}
</script>
<body& ......
示例:
- - - - - - - - - - - -
<body>
<input type="button" value="create" onclick="createTr();">
<table border='1' id="t" >
</table>
<input type="button" value="提交" onclick="okss();" />
</body>
<script type="text/javascript">
&nbs ......
自从学习JavaScript以来,一直对函数闭包不是太理解。知道大概是什么个意思,但是要将一个不会的人教会还真不行。总之就是不能彻底的理解。
今天看到的这篇文章感觉不错,和大家分享一下。
http://www.felixwoo.com/archives/247 ......
对象属性:
document.title //设置文档标题等价于HTML的<title>标签
document.bgColor //设置页面背景色
document.fgCol ......
一,脚本程序与javascript
嵌套在HTML中的语言称为脚本语言,浏览器必须具有脚本引擎对嵌入HTML中的脚本程序进行解释。
eg:
<HTML>
<script language="JavaScript">
//VBScript,Jscript,ECMAScript
<!--
alert(n ......