You need to sign in to do that
Don't have an account?

How to write vanilla HTML in LWC HTML template?
In LWC we write HTML template to add event handler like this.
<template> <input type="text" value={myValue} onchange={handleChange} /> </template>but I want to write this code just like in vanilla HTML like
<template> <input type="text" value={myValue} onchange=handleChange() /> </template>My final HTML generated should be the same.
Thanks for your response. I have gone through the solution but the generated HTML was not the same. I was able to assign ids that I want but I was unable to add event listeners to the elements. So it's not working as expected.