Alternative for document.write()

Alternative for document.write()

Can somebody help me in converting document.write

"<applet code="TestApplet2.class"></applet>"

into a document.createElement() way? because firfox extension is not allowing for document.write()

View Answers

February 25, 2012 at 1:37 PM

<html>
    <body>
        <div id="myDiv1"></div>
        <div id="myDiv2"></div>
    </body>

    <script type="text/javascript">
        var myDiv1 = document.getElementById("myDiv1");
        var myDiv2 = document.getElementById("myDiv2");

        myDiv1.innerHTML = "<b>Content of 1st DIV</b>";
        myDiv2.innerHTML = "<i>Content of second DIV element</i>";
    </script>
</html>

February 25, 2012 at 1:39 PM


February 25, 2012 at 2:21 PM

I do not want to refer it by ID because i am writing an external javascript file which has a function to invoke an applet. Please help by changing this particular part :

document.write

"<applet code="TestApplet2.class"></applet>"

Please convert this line in such a way that it is equivalent to what is stated ..









Related Tutorials/Questions & Answers:

Ads