Before demonstrating the mark-up required for flexible footnoting, we need to consider just what a footnote consists of in structured text. In print, it has two parts: the pointer (an asterisk or number), and the footnote being pointed to. In digital text, such a split is not necessary. The pointer and the footnote itself can be wrapped into a single package, leaving the software to unbundle them and display them in different places.
That is a great benefit. From a writing point of view, a note is an excursion which is most easily tended— and belongs logically— at the place that it jumps off from. The note text can be placed in the stream of text, but be so enclosed in tags so that the reader only sees a "signpost" there.
This signpost is in many ways comparable in purpose to a source anchor, in the mark-up sense of text within
<a> tags that is rendered as a hyperlink.
From today's perspective, you might say even that cross-referencing in print was a precursor to hyperlinking. An asterisk, dagger or superscript digit on the printed page provided the reader with a "hotlink" and it would not be entirely fanciful to say that the reader's eye "clicked" on it, searching for its "target". In 2000, Jenny Lyn Bader wrote a widely quoted Sunday New York Times article (reproduced) arguing that footnotes and hyperlinks are essentially one. She was responding to Gertrude Himmelfarb's 1991 plaint, Where Have All the Footnotes Gone?, and concluded that the hyperlink was satisfying the same passion for cross-referencing that a footnote does in print.