O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Query selector

The querySelector method of the document object provides us with a means to access a DOM element using a CSS query selector, in a manner similar to the jQuery library. We can access the h2 element containing the welcome message, on the IGWEB homepage, using the querySelector method of the document object.

JavaScript

element = document.querySelector(".welcomeHeading");

GopherJS

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

DOMBinding

element := dom.GetWindow().Document().QuerySelector(".welcomeHeading")

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required