0

javascriptに改行を入れたい。使用<br/>, \n and %0D%0Aしましたが、何も起こりませんでした。

これが私のコードです:

var textpara = 'This is dummy text. It will blink and then show.';

これ欲しい:

This is dummy text.
It will blink and then show.

助言がありますか ?

4

3 に答える 3

0

これを試して :

<script lang="JavaScript" >
var textpara = 'This is dummy text. <br/>It will blink and then show.';
document.write(textpara);
</script>

これも機能します。

出力:

This is dummy text. 
It will blink and then show.
于 2013-09-26T05:14:12.007 に答える