Javascript 小技巧全集(7)
//mergeAttributes 复制所有读/写标签属性到指定元素。 SCRIPT function fnMerge(){ oSource.children[1].mergeAttributes(oSource.children[0]); } /SCRIPT SPANID=oSource DIV ID= "oDiv" ATTRIBUTE1= "true" ATT
//mergeAttributes 复制所有读/写标签属性到指定元素。
<SCRIPT>
function fnMerge(){
oSource.children[1].mergeAttributes(oSource.children[0]);
}
</SCRIPT>
<SPAN ID=oSource>
<DIV
ID="oDiv"
ATTRIBUTE1="true"
ATTRIBUTE2="true"
onclick="alert('click');"
onmouseover="this.style.color='#0000FF';"
onmouseout="this.style.color='#000000';"
>
This is a sample <B>DIV</B> element.
</DIV>
<DIV ID="oDiv2">
This is another sample <B>DIV</B> element.
</DIV>
</SPAN>
<INPUT
TYPE="button"
VALUE="Merge Attributes"
onclick="fnMerge()"
>
function fnMerge(){
oSource.children[1].mergeAttributes(oSource.children[0]);
}
</SCRIPT>
<SPAN ID=oSource>
<DIV
ID="oDiv"
ATTRIBUTE1="true"
ATTRIBUTE2="true"
onclick="alert('click');"
onmouseover="this.style.color='#0000FF';"
onmouseout="this.style.color='#000000';"
>
This is a sample <B>DIV</B> element.
</DIV>
<DIV ID="oDiv2">
This is another sample <B>DIV</B> element.
</DIV>
</SPAN>
<INPUT
TYPE="button"
VALUE="Merge Attributes"
onclick="fnMerge()"
>
顶一下
(3)
75%
踩一下
(1)
25%
- 上一篇:用专业代码给网站增加搜索引擎
- 下一篇:html格式文件的下载
- 最新评论 查看所有评论
-
- 发表评论 查看所有评论
-
2012 cheap ugg ugg uggs uggs ugg ugg uggs ugg ugg ugg uggs boots ugg ugg UGGS boots uggs boots. tory burch shoes tory burch outlet for sale.
