【发布时间】:2014-04-30 16:13:53
【问题描述】:
我有以下功能:
var index = 0;
var text = 'Hello world!';
function type() {
document.getElementById('screen').innerHTML += text.charAt(index);
index += 1;
var t = setTimeout('type()',200);
}
我想知道是否可以让它在单词 hello 和 world 之间添加一个 br 标记。
我试过这样:'hello' + br tag + 'world';但没有用,可能是因为 charAt。
谢谢
【问题讨论】:
标签: javascript tags charat