Friday, April 20, 2012

Why writeln(); not producing a new line?

  <script type='text/javascript'> 
//<![CDATA[
for(var j = 0; j < 6;) {
document.writeln(++j);
}
//]]>
</script>


in the above code it suppose to give a new line if referring to the definition of the The writeln() method is identical to the write() method, with the addition of writing a newline character after each statement.



But in my case the output is 123456





No comments:

Post a Comment