Documentation ¶
Overview ¶
Modify `forEachNode` so that the `pre` and `post` functions return a boolean result indicating whether to continue the traversal. Use it to write a function `ElementByID` with the following signature that finds the first HTML element with the specific id attribute. The function should stop the traversal as soon as a match is found.
`func ElementByID(doc *html.Node, id string) *html.Node`
Click to show internal directories.
Click to hide internal directories.