Changing button's image in UI builder

I wanna use a C# script to control my button which in the UI builder. I want to change its background sprite using the script. How can I do it after I do this?

var root = GetComponent<UIDocument>().rootVisualElement;
        A = root.Q<Button>("A");

You set the style.backgroundImage value of your Button.

2 Likes