To disable an element you only need to set "disabled" attribute in element tag
const someElement = document.getElementById('someElement');
someElement.setAttribute('disabled', true);
// remove attribute from HTML element
// remove disable using JavaScript
someElement.removeAttribute('disabled');