Editing front-end code in colab is tricky - you can't keep the code on the same screen as the output and you're stuck typing in a giant text block:
This page shows how to set up a better, hot reloading dev environment. Code is edited locally, uploaded to a public server and polled for changes in the colab iframe.
First, add a python function for js to call and embed some HTML in the colab:
import IPython