jeudi 15 juin 2023

how to access dom in ember 4.12 controller

I have a input box in DOM, and monitor the input value in controller, and there's another button, if the input value is changed, I want to change the button title or properties accordingly, how can I do this in controller?

test.hbs

<input type="text" value="somevalue" />
<button type="button" id="test">test</button>

test.js

  @action
  updatevalue(value) {
    //how to access test button, and change its title?
  }



Aucun commentaire:

Enregistrer un commentaire