js.Value represents a JavaScript value that Go can access through syscall/js. In a JavaScript callback, values arrive as []js.Value; the first argument can be converted with String() and parsed in Go. Go can also reach page elements through js.Global().Get("document"), then read or update properties with Get, Call, and Set. section 12.2.3
Reading and validating an input
A validate function can reject an empty argument, read args[0].String(), parse it with strconv.Atoi, and use js.Global().Call("alert", ...) for feedback. It can retrieve the document element and reset its value with document.Call("getElementById", "providedAnswer").Set("value", ""). section 12.2.3
Listing 12.15 main.go: Retrieving operands
Shows the complete operand-retrieval path from a callback argument to a parsed Go number. section 12.2.3
