Placing the produced <label> element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Label

Description

Placing the produced <label> element

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <script language="javascript">
        function addSomeText()/*from   w w  w .  ja  va 2 s .  c  o  m*/
        {
            var dynaspan = "<label>"+new Date().getTime()+"</label>"
            document.getElementById("clickable").innerHTML += dynaspan;
        }
    
      </script> 
   </head> 
   <body> 
      <div style="width:auto;height:240px;border:1px solid red;" contenteditable="true" id="clickable"> 
      </div> 
      <button onclick="javascript:addSomeText();">Say Something!</button> 
   </body>
</html>

Related Tutorials