java技术,博客,论坛 |
Javascript 小技巧全集(7) |
//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()" > |
共7页:上一页 [1] [2] [3] [4] [5] [6] [7] |
Copyright (C) 2004 http://www.onejava.com, Java技术联盟. All Rights Reserved