<script language="javascript">
function test(){
var length = document.all.custom.innerHTML;
}
</script>
<table id='custom'>
......
</table>
test函数中length变量能得到table标签里面的所有html源码,即为......中所代表的东西!

解决方案 »

  1.   

    在button的onclick事件中调用一个JavaScript函数
    在函数体中,先得到form的对象,将对象进行tostring()操作,将结果写到texarea中就可以了
      

  2.   

    将你要显示的html代码括在<div></div>里
    当点button时,将div的innerHtml传给弹处窗口或textarea
      

  3.   

    具体的代码是function test(){
    var obj = document.getElementById('id');
    var html = obj.innerHTML;
    document.getElementById('textareaid').value=html
    }