function declOfNum(number, titles) {
cases = [2, 0, 1, 1, 1, 2];
return number+" "+titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ];
}
var date = declOfNum(new Date().getFullYear() - 2005, ['год', 'года', 'лет'])
var el = document.getElementById("demo")
el.innerText = date
<input type="text" id="i1">
<input type="text" id="i2">
const i1 = document.querySelector('#i1');
const i2 = document.querySelector('#i2');
i1.addEventListener('input', function (e) {
if (e.target.value) {
i2.setAttribute('disabled', true);
} else {
i2.removeAttribute('disabled');
}
});
i2.addEventListener('input', function (e) {
if (e.target.value) {
i1.setAttribute('disabled', true);
} else {
i1.removeAttribute('disabled');
}
});
<input type="checkbox" name="notify" value="1" id="input-notify" />
<input type="checkbox" name="notify" value="1" id="input-notify" checked />