in jade file
var = document.getElementById("score").text();
You should wrap your code with a
script tag, so the script is executed on the browser and not during the compiling process. "Cannot read property
undefined" means that you are using DOM APIs directly in your Jade files and these APIs do not exist in that environment.