Button onClick to output Applet - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Button

Description

Button onClick to output Applet

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title> Welcome on board! </title> 
      <script type="text/javascript">
        function loadApplet()/*from w  w w.  j  a v a  2 s .c o m*/
        {
        console.log("Load Applet");
        document.write("<applet code='MyApplet' height='300' width='300'></applet>");
        }
    
      </script> 
   </head> 
   <body> 
      <p>Click here for new Applet session!</p> 
      <button onclick="loadApplet();">Click here</button>  
   </body>
</html>

Related Tutorials