Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  

Alternative for document.write()



Share on Google+Share on Google+

Alternative for document.write()
3 Answer(s)      5 years and 5 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

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

    <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>";

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 :


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