I created a button for table cell using innerHTML. it is working perfectly in mozilla. But it is now working inn IE. Button is now displaying in IE. Please help me
raveeshlawrance
0
Newbie Poster
Recommended Answers
Jump to PostYou can do it this way:
<html> <head> <title></title> <script type="text/javascript"> <!-- function createButton() { var div = ( document.all ) ? document.all['myDiv'] : document.getElementById('myDiv'); div.innerHTML = '<button id="btn" name="btn">Button</button>'; } //--> </script> </head> <body> <div id="myDiv" onclick="createButton();">Click Me!</div> </body> </html>
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.