JavaScript Tutorial/Document/write
Содержание
- 1 Do calculation in document.write
- 2 document.writeln()
- 3 Escape quotation marks in document.write
- 4 Output all array element with document.write
- 5 Output the HTML tags by using the document.write
- 6 Use document.write between the HTML tags
- 7 Use document.write() to output the HTML tags
- 8 Writing to a Document
Do calculation in document.write
<source lang="javascript">
<html> <head> <title>Find the area and circumference of a circle</title> <script type="text/javascript" language="javascript">
</script> </head> <body onload="FindArea()"> </body> </html></source>
document.writeln()
Syntax
<source lang="javascript">
document.writeln(value,....)</source>
Escape quotation marks in document.write
<source lang="javascript">
<HTML> <BODY> <SCRIPT language="JavaScript">
</SCRIPT> </BODY> </HTML></source>
Output all array element with document.write
<source lang="javascript">
<html> <head> <title>Writing an Array</title> </head> <body>
<script language="javascript" type="text/javascript"> </script>
</body> </html></source>
Output the HTML tags by using the document.write
<source lang="javascript">
<HTML> <BODY> <SCRIPT language="JavaScript">
</SCRIPT> </BODY> </HTML></source>
Use document.write between the HTML tags
<source lang="javascript">
<HTML> <BODY> start
<SCRIPT language="JavaScript"> </SCRIPT> <P> end </BODY> </HTML></source>
Use document.write() to output the HTML tags
<source lang="javascript">
<html> <head> <title>Writing HTML</title> </head> <body> <script language="javascript" type="text/javascript">
</script> </body> </html></source>
Writing to a Document
<p>Syntax
<source lang="javascript">
document.write(value,....)</source>