Discussions » Creation Requests

Re-enable an element

§
Posted: 2017-06-14

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?

wOxxOmMod
§
Posted: 2017-06-14

The simplest approach is to check periodically:

setInterval(() => {
  const el = document.getElementById('chatInputAreaWithQuotes');
  if (el && el.disabled) {
    el.disabled = false;
  }
}, 100);
§
Posted: 2017-06-14

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

wOxxOmMod
§
Posted: 2017-06-15

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

§
Posted: 2017-06-15

It works, thanks.

Post reply

Sign in to post a reply.