JavaScript Reference/Javascript Methods/writeln

Материал из Web эксперт
Перейти к: навигация, поиск

"writeln()" Example

    
<html>
<body>
<script language="JavaScript">
function function1() {
    var m = "<p>First paragraph.</p>";
    m += "<p>second paragraph.</p>"
    document.writeln(m); 
}
</script>
<input type="button" value="Add some HTML content to this page" onClick="function1();">
</body>
</html>



"writeln()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |document                                                      |
+----------------+--------------------------------------------------------------+



"writeln()" Syntax, Parameters and Note

Note:
Writes HTML document content followed by a carriage return.
    
Syntax:
    
document.writeln(param1)
Parameters:
    param1   Required; the text and HTML tags to write.