hide input border on focus
package main
import (
"fmt"
"syscall/js"
)
func main() {
document := js.Global().Get("document")
input := document.Call("getElementById", "yourInputID")
// Attach focus event listener
input.Call("addEventListener", "focus", js.FuncOf(func(this js.Value, p []js.Value) interface{} {
// Add a CSS class to hide the input border on focus
input.Get("classList").Call("add", "hide-border")
return nil
}))
// Attach blur event listener
input.Call("addEventListener", "blur", js.FuncOf(func(this js.Value, p []js.Value) interface{} {
// Remove the CSS class to show the input border on blur
input.Get("classList").Call("remove", "hide-border")
return nil
}))
fmt.Println("Go WebAssembly app started")
select {}
}
Make sure to replace "yourInputID"
with the actual ID of your input element.