The main issue with this is that you lose text reflowing, so it's more annoying to access on mobile. You also lose interactivity; I've seen links and menus implemented with JavaScript break.
HTML is also easier to fix is something gets in the way of content.