Javascript to edit a HTML file. Where to begin?

Javascript to edit a HTML file. Where to begin?