[GopherJS] getElementsByTagName


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:

[1]GopherJS - A compiler from Go to JavaScript (GitHub, GopherJS Playground, godoc)
[2][Golang] querySelectorAll and querySelector Example by GopherJS