How to add text to a box ?

Hello everybody.

I have created a GUIBox, and I want it to display text when I ask for it.
For example, when I press the button “Attack”, a text appears in the box : “You attacked”.
The box will always be present.

I don’t know if it’s possible ?

Thanks for your answers and sorry for bad english, it’s not my first language.

EDIT :
this video help me a lot : UI Text - Unity Official Tutorials - YouTube

PLUS if it’s possible, I want to conserve all the text in screen, not just 1 line, but for the moment I don’t know how to do.

Gameobject ui text, to add the text
Then you want to create a script in the text component
Unityengine.Ui at the top of it
Creat a public text textInsideBox
Drag the text element to the empty text box on the inspector.
Then you can change textInsideBox from inside the script anytime you want

Try this simple example:

string customText;
onGUI()
{
GUI.Rect(new Rect(TextRect),""+customText);

if(GUI.Button(new Rect(buttonRect),"Attack Button")
{
customText = "Add your text here";
}
}