The Document Object Model (DOM) gives Go code a way to inspect and modify an HTML page. In a WebAssembly application, Go retrieves the document, finds elements by ID, and updates their properties. section 12.2 section 12.2.1
A Go program can use the DOM to:
- Find an element with document.Call("getElementById", id). section 12.2.1
- Change displayed content by setting the element's innerHTML property. section 12.2.1
- Read form input through an argument passed from JavaScript or through the element's value property. section 12.2.3
Multiplication quiz
An HTML page provides spans with operand1 and operand2 IDs plus a numeric answer field. Go generates operands, writes them into the spans, reads the submitted answer, and generates a new exercise after a correct result. section 12.2







