I have multiple buttons with the same class attribute but different ids. I tried disabling them but failed. submit submit
document.querySelector(".submit").disable = true;
While .querySelector() returns only the first element you need .querySelectorAll() in order to disable all buttons with the same class. Instead of disable you need to use disabled and a loop like forEach:
document.querySelectorAll(".submit").forEach(e => e.disabled = true)
<button type="button" class="submit">1</button>
<button type="button" class="submit">2</button>
<button type="button" class="submit">3</button>
<button type="button" class="submit">4</button>