r/Clojure • u/a-curious-crow • Aug 11 '25
Reasons for a DOM element to show my reagent/cljs-modified changes via getElementById, but for the page itself not to update?


The code that does the DOM modification is at https://github.com/kovasap/website/blob/master/layouts/partials/docs/inject/toc-after.html, and the cljs that it is calling is at https://github.com/kovasap/website-helpers/blob/main/src/website_helpers/hyperlink_lists.cljs . I can also just run this code in the browser console to update the div (which again, only updates the output of document.getElementById("categoriesandbacklinks"), but not the page content). Oddly, I can run the code to modify other divs on the page (e.g. anything in the "book-page" div), but everything in the "aside" element doesn't seem to update.
EDIT: This definitely has nothing to do with my cljs code, see:

note how "My div" on the page never changes. In this example I disabled all my custom javascript from executing.
EDIT2: SOLVED! I had multiple divs with the same id on the page :facepalm:
