日期:2014-05-16 浏览次数:20450 次
<!DOCTYPE HTML> <html> <head> <meta charset="gb2312" /> <title></title> </head> <body> <table border=1 width="603" height="53"> <tr align="center"> <td width="352"><div id="Layer1"><a href="#">个人中心</a></div> <fieldset></fieldset> <div id="Layer2"><a href="#">相册</a></div> <div id="Layer3"><a href="#">留言板</a></div></td> <td width="235"><div id="Layer4"> <input type="button" name="button" value="移动" id="btn" /> </div></td> </tr> </table> <script> function $(el){ return typeof el == 'string' ? document.getElementById(el) : el; } $('btn').onclick= function(){ var tmp = $('Layer2').innerHTML; $('Layer2').innerHTML = $('Layer1').innerHTML; $('Layer1').innerHTML = tmp; } </script> </body> </html>