Commit 50dd9cbd authored by Siong-Ui Te's avatar Siong-Ui Te

better syntax

parent eeaa06cd
......@@ -56,11 +56,15 @@ func possibleWordClickHandler(word string) {
}
func HighlightWord(i int, word string) {
Document.QuerySelector("#word-index-" + strconv.Itoa(i)).ClassList().Add("word-highlight")
for _, elm := range Document.QuerySelectorAll("#word-index-" + strconv.Itoa(i)) {
elm.ClassList().Add("word-highlight")
}
}
func UnhighlightWord(i int, word string) {
Document.QuerySelector("#word-index-" + strconv.Itoa(i)).ClassList().Remove("word-highlight")
for _, elm := range Document.QuerySelectorAll("#word-index-" + strconv.Itoa(i)) {
elm.ClassList().Remove("word-highlight")
}
}
func possibleWordMouseenterHandler(i int, word string) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment