Home > Software engineering >  Is there alternate for dom event listeners in express js
Is there alternate for dom event listeners in express js

Time:03-23

since express js doesn't allow Dom related commands, so I am not able to keep tracks of buttons i.e. when they are clicked. Not just button clicking but any kind of tracking is not possible. Can anyone please suggest a alternate for this. If there is nothing in express, a new library or anything that can work with express and help me with this. Thank you

CodePudding user response:

You are confusing things here. Express.js runs on the backend. There is no DOM on the backend, hence there is no API to manipulate the DOM.

You can use template engines (express supports e.g. handlebars and EJS) and link JavaScript files within the HTML that you return. Or you use a frontend framework like React, Vue, Svelte, Angular etc. in order to do this.

  • Related