Docker-Docs/js/anchorlinks.js

9 lines
263 B
JavaScript
Raw Permalink Normal View History

2020-11-18 13:32:27 -05:00
(function (d) {
"use strict";
for (const h of d.querySelectorAll("H1, H2, H3")) {
if (h.id != null && h.id.length > 0) {
h.insertAdjacentHTML('beforeend', `<a href="#${h.id}" class="anchorLink">🔗</a>`)
}
}
})(document);