Call document write function with document.write.call(document,); - Javascript Function

Javascript examples for Function:Function Call

Description

Call document write function with document.write.call(document,);

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() {//from   w  w  w .  j a  v a 2 s  .  c o  m

function splitInto(str, len) {
    var regex = new RegExp('.{' + len + '}|.{1,' + Number(len-1) + '}', 'g');
    return str.match(regex );
}

document.write.call(document, splitInto('12345678909876754432321', 3).join('<br>'));
    });

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

Related Tutorials