177、点击改变文字

177、点击改变文字

脚本说明:

把如下代码加入<body>区域中:

<SCRIPT LANGUAGE="JAVASCRIPT">

 

n = (document.layers) ? 1:0

ie = (document.all) ? 1:0

function change_content(divname, newtext) {

    if (n) {

        document.layers[divname].document.write(newtext)

        document.layers[divname].document.close()

    }

    if (ie) document.all[divname].innerHTML = newtext

}

 

</SCRIPT>

<A HREF="#" onClick="change_content('layer1', 'This is the new text!')">Change the current text to "This is the new text!"</A><BR>

<DIV ID="layer1" STYLE="position:absolute; top:100; left:200; visibility:visible">

This is a layer called "layer1"<BR>

</DIV>

 

Write a comment

Comments: 0