HTML DOM Document writeln() 方法
- အရှေ့လွှတ် write()
- နောက်လွှတ် all[]
- အဆင်းအတန်း အထိပ်သို့ HTML DOM Documents
定义和用法
writeln()
方法直接写入打开的 (HTML) 文档流。
writeln()
方法与 write() 方法相同,只是在每条语句后添加换行符。
警告
writeln()
方法在已加载的文档上使用时会删除所有现有的 HTML。
writeln()
方法不能用于 XHTML 或 XML。
另请参阅:
အကျိုးသုံး
document.writeln("Hello World!"); document.writeln("Have a nice day!");
语法
document.writeln(exp1, exp2, exp3, ...)
参数
参数 | 描述 |
---|---|
exp1, exp2, exp3, ... |
可选。输出流。 允许多个参数,并将按出现的顺序追加到文档中。 |
တုံ့ပြန်ချက်
အမှတ်ပြု
write() နှင့် writeln() အကွာအပြား
writeln() သည် ချက်ပြု ပြီးနောက် အခြား ချက်ပြု တွင် ပြန်လည်သုံး ပြုလုပ်သည်။ write() သည် မပြုလုပ်ပါ။
အကျိုးသုံး
document.write("Hello World!"); document.write("Have a nice day!"); document.write("<br>"); document.writeln("Hello World!"); document.writeln("Have a nice day!");
အဆိုပါ
အီလက်တာ တွင် သုံးပါ writeln() အကျိုးသား မဟုတ်ပါ။ သူ့ကို အချက်ပြု ရုပ်သုံး အတွက် (type=".txt") အသုံးပြုသည်ကို သာ အသုံးပြုသည်။ အီလက်တာ တွင် ပြန်လည်သုံးသည်မှာ အဆိုပါ ပြန်လည်သုံး မှာ မမှန်ကန်ပါ။
အမှတ်ပြု အလို့ငှာ အီလက်တာ ကို သုံးပါပုံနှိပ်သို့မဟုတ် <br>
:
လက်ရှိ လောက် 1
document.write("Hello World!"); document.write("<br>"); document.write("Have a nice day!");
လက်ရှိ လောက် 2
document.write("<p>Hello World!</p>"); document.write("<p>Have a nice day!</p>");
ဘရပ်သူများ ထောက်ပံ့
အားလုံး ဘရပ်သူများ က ထောက်ပံ့ပေးသည် document.write
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
ထောက်ပံ့ | ထောက်ပံ့ | ထောက်ပံ့ | ထောက်ပံ့ | ထောက်ပံ့ | ထောက်ပံ့ |
- အရှေ့လွှတ် write()
- နောက်လွှတ် all[]
- အဆင်းအတန်း အထိပ်သို့ HTML DOM Documents