The trick to write vanilla HTML is to make it static (no dynamic changes except layout/mobile responsiveness)
Meanwhile the trick to writing a statefull app in vanilla JS is to not use HTML instead create the DOM tree using JS functions which gives you the ability to use higher abstractions, local/private state management and automatic UX tests.