0

I have tried multiple answers already, and none of them work. Here's what I've tried :

  • element.value = '0'
  • element.dispatchEvent(new KeyboardEvent('keydown', { key: '0' }))
  • element.dispatchEvent(new KeyboardEvent('keypress', { key: '0' }))
  • Each of those followed by a call to dispatchEvent(new Event('input', { buubles: true, cancelable: true }));

What else can I try ? Some do update the field, but the content gets deleted immediately after.

ouai
  • 150
  • 1
  • 10

0 Answers0