§
Δημοσιεύτηκε: 14/06/2017

Re-enable an element

I'd like to prevent a text box in Skype Web from being disabled. It gets a disabled attribute and deleting it in dom inspector re-enables it. So I think that if a script could remove that attribute it won't disable. I wrote this:
document.getElementById('chatInputAreaWithQuotes').removeAttribute('disabled');
Unfortunately it doesn't work. Could someone help me with it?

woxxomΣυντονιστής
§
Δημοσιεύτηκε: 14/06/2017

The simplest approach is to check periodically:

setInterval(() => {
  const el = document.getElementById('chatInputAreaWithQuotes');
  if (el && el.disabled) {
    el.disabled = false;
  }
}, 100);
§
Δημοσιεύτηκε: 14/06/2017

Actually I tried it again it worked, thanks. I'd like the same thing with a button found by class: .swx-expression-picker-btn.

woxxomΣυντονιστής
§
Δημοσιεύτηκε: 15/06/2017

Use const el = document.getElementsByClassName('swx-expression-picker-btn')[0]

§
Δημοσιεύτηκε: 15/06/2017

It works, thanks.

Δημοσίευση απάντησης

Συνδεθείτε για να δημοσιεύσετε μια απάντηση.