Sorry if this is something trivial. I tried to do some due diligence googling with no luck.
The function getElementById seems to be returning null where it shouldn't.
I'm currently using
lein-cljsbuild 1.1.2
clojure 1.7.0
clojurescript 1.7.170
and compiling with optimizations: :none
Here's my HTML:
<!DOCTYPE html>
<html>
<head>
<script src="js/main.js"></script>
</head>
<body>
<div id="test-content">Test text</div>
</body>
</html>
Here's my Clojurescript:
(ns gol-cljs.core)
(.log js/console (. js/document getElementById "test-content"))
This prints "null" to Chrome's browser console.
Attempting any operations on (. js/document getElementById "test-content")) gives errors about trying to do things with "null".
Is there some requirement I'm missing for accessing the dom?
Best,
Nathan