Hi, With IE7, the following code doesn't add the table to the page when button is clicked. the code is also uploaded to http://startupisrael.com/gpazi/triptouch/test.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> </head> <body> <script language="Javascript" type="text/javascript"> function func() { var mydiv = document.getElementById("mydiv"); var mytable = document.createElement("table"); var mytr = document.createElement("tr"); var mytd = document.createElement("td"); var mytext = document.createTextNode("this is my text"); mytd.appendChild(mytext); mytr.appendChild(mytd); mytable.appendChild(mytr); mydiv.appendChild(mytable); } </script> <div id="mydiv"><button onclick="func();">click</button></div> </body> </html>
It's trying it's hardest to be xhtml compliant, use a different element like div <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> </head> <body> <script language="Javascript" type="text/javascript"> function func() { var wm_previewDiv = document.getElementById("aaa"); var div = document.createElement( "div" ); var textNode = document.createTextNode( "date" ); div.appendChild( textNode ); wm_previewDiv.appendChild( div ); } </script> <div id="aaa"><button onclick="func();">click</button></div> </body> </html> HTML: