Home Answers Viewqa JavaScriptQuestions Alternative for document.write()

 
 


Suraj
Alternative for document.write()
3 Answer(s)      a year and 3 months ago
Posted in : JavaScript Questions

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 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 Pages:

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.