Answer the question
In order to leave comments, you need to log in
How can I change the name of a button when it is clicked?
Hello everyone. There is a button, how to make it so that when you click on the button, its name changes? For example: it was "Edit", clicked, it became "Save". Thanks in advance for your answer.
<button pButton type="button" label="Редактировать" style="width:auto"></button>
Answer the question
In order to leave comments, you need to log in
<button #button (click)="changeButton(button)">Редактировать</button>
changeButton(button) {
button.innerText = "Сохранить";
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question