Answer the question
In order to leave comments, you need to log in
How to change text on button click wix(corvid)?
Good afternoon everyone!
Please tell me how can I change the text of another element by clicking on an element?
//у меня есть кнопка с id = "button1"
//нужно изменить допустим HTML элемент с id = "html1"
export function button1(event) {
//???
}
Answer the question
In order to leave comments, you need to log in
You put a click event on the button.
Code is generated.
Then you access the element through the $w variable and set its text property to the value in my case #text is the H1 heading. You can do the same with any other element on the page
Syntax is similar to C#
export function button1_click(event) {
$w('#text1').text = 'Hello world';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question