.disabled {
display: block !important; /* since you set the element's display to none inline,
we need to use !important flag (which is pretty bad)
to override the inline style */
pointer-events: none; /* Disable an element interaction, so it will not respond any event */
color: #ccc; /* Gray out the text color to signify being disabled */
}

Now in your javascript, just give the element you want to disable the class disabled like so