搞了一天,终于把A里面的属性弄出来
1
2
3
4
5
6
7
8
9
10
11
12
|
<
html
>
<
BODY
>
<
SCRIPT
LANGUAGE
=
"JavaScript"
>
<!--
var A = document.createElement("A");
A.setAttribute("href","#");
A.appendChild(document.createTextNode("一些文字"));
document.getElementsByTagName("BODY")[0].appendChild(A);
//-->
</
SCRIPT
>
</
BODY
>
</
html
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<
HTML
>
<
HEAD
>
<
TITLE
> New Document </
TITLE
>
<
script
>
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";
}
}
</
script
>
</
HEAD
>
<
BODY
onload
=
newelement
()>
<
SPAN
ID
=
"oData"
></
SPAN
>
</
BODY
>
详细请参考:http://www.codesky.net/article/201004/97149.html
|
crackernet