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需刷新才能执行]
代码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需刷新才能执行]
相关文章推荐
- document.createElement("A")比较不错的属性
- document.createElement("A")比较不错的属性
- document.getElementById("xx").style.xxx中的所有属性
- window、document、html、body、element的事件属性比较
- 【随笔记录】document.createElement创建添加属性
- document.createElement("A");
- 简化document.createElement("div")动态生成层方法 (转)
- document.getElementById("idName")用js方法获取元素,则设定风格属性的方法为
- 【转】JS写图层方法.document.createElement("div")
- document.getElementById("xx").style.xxx中的所有属性
- document.getElementById("xx").style.xxx中的所有属性
- 简化document.createElement("div")动态生成层方法
- IE中document.createElement的iframe无法设置属性name问题
- document.getElementById("xx").style.xxx中的所有属性
- 【转】document.getElementById("xx").style.xxx中的全部属性
- jquery 根据name属性获取对象(=document.getElementByName("") )
- document.createElement("input")动态创建html元素时checkbox和radio默认选中的问题
- document.createElement等DOM函数与属性
- JavaScript基础 创建节点 为节点添加属性 将节点挂载到body节点下 document.createElement setAttribute appendChild
- 简化document.createElement("div")动态生成层方法 (转)