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

Accessing and manipulating the DOM

As noted previously, we can use JavaScript to access and manipulate the DOM for a given web page. Since GopherJS transpiles to JavaScript, we now have the capability to access and manipulate the DOM within the confines of Go. Figure 3.2 depicts a JavaScript Program accessing/manipulating the DOM along with a Go program also accessing/manipulating the DOM:

Figure 3.2: The DOM can be accessed and manipulated by a JavaScript program and/or a Go program (using GopherJS)

Now, let's take a look at a few simple programming snippets, where we can access the JavaScript functionality using Go, followed by some basic ...

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