<nav>
  <button onclick="switchTo(this.innerText)">1</button>
  <button onclick="switchTo(this.innerText)">2</button>
</nav>
<textarea id="note" rows=20 cols=80 onchange="updateNote(this.value)"></textarea>
let notes = [];
let currentNote = 0;

function switchTo(n) {
  let noteArea = document.getElementById('note');
  currentNote = n - 1;
  noteArea.value = notes[currentNote] ? notes[currentNote] : "";
}

function updateNote(value) {
  notes[currentNote] = value;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.