Show/hide element in canvas on DOM focus

I have a simple form in DOM having some input fields (a1, a2, a3) and each value is the length of a canvas element.

I would like to add a guide to show the focused input field. How is the best to show/ hide it depending on the input focus?

In my init I have set:

        this.scene.getObjectByName("help_a1").visible = false;

How can I swap it to true from the DOM?

Thanks for your help or suggestion!

scene.getObjectByName(“help_a1”).visible = ! scene.getObjectByName(“help_a1”).visible;
It toggles the Object3D help_a1.
Object scene must have global reference. If you are using modules, then after defining scene create global reference like this:
window.scene = scene;

1 Like