Save HTML block in a string variable - Javascript String Operation

Javascript examples for String Operation:String HTML

Description

Save HTML block in a string variable

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(){/*w ww .  j a v  a2 s .co m*/
var anotherListItem = "<div class= 'form-list'>"+
                         "<button class= 'done'></button>"+
                         "<input type= 'text'>"+
                      "</div>"
console.log(anotherListItem);
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials