Topic: How to update showcounter when value is set by js?

METOURNEAU free asked 10 months ago

Expected behavior The counter is updated when js set value to the input.

Which event should be called?

Actual behavior The counter is not updated when js set value to the input

Resources (screenshots, code snippets etc.)


Grzegorz Bujański staff answered 10 months ago

Try this:

const input = document.getElementById("textcount");
input.value = 'test'
const event = new Event('input');


Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 3.10.1
  • Device: hp
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: Yes