First of all, I know this kind of questions have been asked thousand of times, but why doesnt this work? I have a chrome extension with an options.html and a save button for saving things to local storage:
<div>
<button type="button" name="save" class="btn btn-primary btn-md active" id="save">SAVE</button>
</div>
And this is my options.js:
document.getElementById('save').addEventListener('click',
save_options);
However, it gives me this error in chrome console:
Uncaught TypeError: Cannot read property 'addEventListener' of null
What am I overlooking?