4

[GopherJS] getElementsByTagName

 2 years ago
source link: http://siongui.github.io/2016/06/06/gopherjs-getElementsByTagName/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

[GopherJS] getElementsByTagName

June 06, 2016

Use getElementsByTagName to access head element via GopherJS.

import "github.com/gopherjs/gopherjs/js"

head := js.Global.Get("document").Call("getElementsByTagName", "head").Call("item", 0)

You can also use querySelector [2] to access head element:

head := js.Global.Get("document").Call("querySelector", "head")

References:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK