AFAIK, there is no DOMContentReady event, there is DOMContentLoaded
Try replacing your code with this -
function check() {
alert('its working');
};
document.addEventListener('DOMContentLoaded', function () {
document.getElementById('login').addEventListener('click', check);
});