Use class attribute for CSS and id attribute for JavaScript.

html
<div class="container" id="container"></div>
css
.container { background: '#aaa' }
js
var container = document.getElementById('container');