• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Writing to a Document

The most popular document object methods are the write and writeln methods. These methods enable you to write text to a web page; the writeln method is the same as the write method, except that it adds a carriage return character after the text it writes. Note that carriage returns do not show up in web pages—you need an element such as the <BR> element to skip to the next line in a web page displayed in a browser. However, the carriage return can help format the source HTML of an HTML document and make it easier to read. Here’s the syntax for these methods:

write(text) 
writeln(text) 


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint