我已经尝试过了:
document.write(<div class="line01">
+ text [0] + </div>
);
就CSS而言,这看起来还不错,但要输出的元素应该是一个字符串:
改变这个:
document.write(<div class="line01"> + text[0] + </div>);
对此:
document.write('<div class="line01">' + text[0] + '</div>');
更多关于document.write
可以是found here