I am not an expert but this is simple
Fisrt way is with the commandbutton.
We have one label, one textbox, one commandbutton.
in the command button in click method type this code in:
Easy isn't it
The second way without command button is not that easy
In the textbox in the keypress type this code in:
Third way to do it is without the commandbutton and without typing ENTER
in the textbox in interactivechange type this code in: