<div class="htmlarea"> <textarea id="runcode96825"> <a href="#nogo">blueidea</a> <a href="#nogo">google</a> <a href="#nogo">yahoo</a> <a href="#nogo">sun</a> <script> function attachLinksEvent() { var links=document.getElementsByTagName('a'); for(var i=0;i<links.length;i++) { links[i].onmouseover=linkBehavior; } } function linkBehavior(e) { if(e==null) e=window.event; if(e.target) alert(e.target.innerHTML); else alert(e.srcElement.innerHTML); } window.onload=attachLinksEvent; </script> </textarea><br><input onclick="runEx('runcode96825')" type="button" value="运行代码"> <input onclick="doCopy('runcode96825')" type="button" value="复制代码"> <input onclick="doSave(runcode96825)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div>