It seems like I'm missing something obvious here, as I'm working with node.js and I have correctly linked a javascript file (alert("hello");
works). However, I can't seem to make any changes to the DOM. Here's a simple example:
jade:
doctype html
html
head
link(rel='stylesheet', href='/stylesheets/styles.css')
script(src='/javascripts/script.js')
body
block index_block
div#divClassName
stylus:
#divClassName
background-color red
width 200px
height 200px
js:
alert("hello");
var div = document.getElementById("divClassName");
div.style.backgroundColor = "green";
Even though I try to change the color of the box to green, it remains red. Any ideas on why this might be happening? Thanks.