code: function editAnnotation(region) {
      var form = document.forms.edit;
      form.style.opacity = 1;
      (form.elements.start.value = Math.round(region.start * 10) / 10),
          (form.elements.end.value = Math.round(region.end * 10) / 10);
      form.elements.note.value = region.data.note || '';
      form.onsubmit = function(e) {
          e.preventDefault();
          region.update({
              start: form.elements.start.value,
              end: form.elements.end.value,
              data: {
                  note: form.elements.note.value
              }
          });
          form.style.opacity = 0;
      };
      form.onreset = function() {
          form.style.opacity = 0;
          form.dataset.region = null;
      };
      form.dataset.region = region.id;
  }
docs: Edit annotation for a region.