日期:2014-05-16 浏览次数:20357 次
1)document.getElementById('u_name');
2) document.forms[0].u_name;
3) document.form(0).u_namedocument.forms[0].target='_blank';//forms[0]是第一个form
<div onclick='go("http://www.google.com.cn");'>
<a href="#" onclick='go("http://www.baidu.com");'>Go ===></a>
</div>function go(url){
alert(url);
window.location.href = url;
}function wopen(){
var text = getElementById('infomation').innerHtml;
var win = window.open('','_blank','');
win.document.open('text/html','hcq');
win.document.writeln(text);
win.document.close();
}document.title='msg';//一句话就OK当然也可以再写一个让它滚动的函数,这样效果就更好了。
<script language="JavaScript" type="text/javascript">
<!--
var userName="jack";
//根据用户名显示欢迎信息
function hello(_name){
alert("hello,"+_name);
}
//创建一个函数,用于返回一个无参数函数
function _hello(_name){
return function(){
hello(_name);
}
}
window.setTimeout(_hello(userName),3000);
//-->
</script><tr onmouseover='this.style.color="#e7fbff"' onmouseout='this.style.color="#FFFFFF"' > …… </tr>最好是把和样式设置相关的都放进css里,以后改了方便。