0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

flutter for webでDOM

Posted at

なんとかして、flutter for webで作成したサイトにmetaタグを挿入したかった。

まずjsとhtmlを。

importします。

import 'dart:html' as html;
import 'dart:js' as js;

jsから操作します。

var meta = html.document.createElement("meta");
meta.setAttribute("name", "*******");
meta.setAttribute("content","******");
html.document.getElementsByTagName("head")[0].append(meta);

完了!

ちなみに

metaではない場合は

html.document.querySelector('body').insertAdjacentHtml('beforeend', '<div></div>');

こんな感じで行けました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?