Quote:The problem with document.writeln() is that the results will change depending on where in the page you put the script. Your code always appends text to the end of the <body>, so it doesn't have that problem, but it's also not particularly useful. (Also, writeln() doesn't append a <br>, it appends a line break. There's a difference.) The proper way to insert text dynamically is to create an HTML element that will hold the dynamic text, and set the content of that element: HTML <p>Good morning <span id="userName">unknown user</span>.</p> ... $('#userName').text('Mike') // or append(), or html()
document.writeln()
<body>
writeln()
<br>
HTML
<p>Good morning <span id="userName">unknown user</span>.</p> ... $('#userName').text('Mike') // or append(), or html()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)