I want to hide a element by code. And I can get the element’s reference. The method doesn’t work just like the picture.

And I also try to modify “class”, not work similarly.

Is there anything missing? I can manual set “display” by UI Toolkit Dubugger, and the UI works well. But how to do that by Script?
Maybe I did not understand question but is this not what you are looking for? This is how I hide element. .....style.display = DisplayStyle.None;
The problem is that the code doesn’t work for me. And all modify element style by code don’t work.
update: What I manipulated element is out of screen, and I didn’t noticed it. Now it’s all right.