Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想向<span>hello</span>元素添加任意位的 HTML(如 )。我如何在 Dart 中做到这一点?
<span>hello</span>
您可以使用 向元素添加任意位的 HTML appendHtml('<span>some html</span>'),如下所示:
appendHtml('<span>some html</span>')
import 'dart:html'; main() { var elem = new DivElement(); elem.appendHtml('<span>hello</span>'); }
该appendHtml方法将解析 HTML 并将结果节点添加为元素的最后一个子元素。
appendHtml