get html of element itself using HTML5 and HTML4 - Javascript DOM

Javascript examples for DOM:Element outerHTML

Description

get html of element itself using HTML5 and HTML4

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*  www .j a v a 2 s.c om*/
console.log(scheduledDate.outerHTML);//HTML5
//HTML4.01 -(FF).
console.log(document.getElementById("scheduledDate").outerHTML);
}

      </script> 
   </head> 
   <body> 
      <div id="content">
         content div
      </div> 
      <input type="text" id="scheduledDate" class="datetime">  
   </body>
</html>

Related Tutorials