<html>
<head>
<script>
function doIt() {
     var x=document.getElementById('dajm');     
     var a=document.form.copyArea.value=x.innerHTML;
     window.clipboardData.setData('text',a.replace(/<[^<>]+>/g,""))
}
</script>
</head><body onload="doIt()"><p>Outside Div</p>
<div id="dajm">
  <table border="1" width="100%">
    <tr>
      <td width="50%">Inside Div</td>
      <td width="50%">&nbsp;</td>
    </tr>
    <tr>
      <td width="50%">&nbsp;</td>
      <td width="50%">&nbsp;</td>
    </tr>
  </table>
</div>
<form name="form">
  <input type="hidden" name="copyArea" value>
</form>
<textarea style="width:100%;height:400px;"></textarea>
<p>Outside Div</p>
</body>
</html>