Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions Alternative for document.write()
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


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


Advertisement
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 Tutorials/Questions & Answers:
 

 

 

DMCA.com