您的位置:首页 > 其它

document.createElement("A")比较不错的属性

2007-08-10 00:00 295 查看
搞了一天,终于把A里面的属性弄出来
代码1:







[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

代码2:


New Document

function newelement(){
var a=document.createElement("a");
a.href="javascript:alert('A link.')";
a.innerHTML="aaa";
var img=new Image();
img.src="http://img.baidu.com/img/post-jg.gif";
img.style.border="none";

a.appendChild(img)
document.getElementById("oData").appendChild(a);

img.onmouseover=function(){
this.src="http://www.baidu.com/img/sslm1_logo.gif";
}

img.onmouseout=function(){
this.src="http://img.baidu.com/img/post-jg.gif";
}
}






[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: