Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

149
Visualizações
HTML: Track when an element changes from readonly to not readonly?

I'm looking for a solution to track when an HTML element (tag, like a textarea input box) changes from attribute 'readonly' to being not read-only (having the attribute removed as far as I can tell). I'm not yet finding a way to do this in Chrome Dev Tools or vanilla JavaScript or jQuery (I haven't used Firefox for web dev in a long time, sorry).

If I can catch that, and print it out to console.log, that would be great so then I could trace when it's happening, since I'm unable to reproduce a bug the user is reporting under some circumstance.

I've seen some things about MutationObserver though that appears to be an abandoned project and I'm not sure that's a good path to go down. I know I can look up some events in Chrome Dev Tools, but maybe I'm just not seeing what I'm looking for.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

MutationObserver isn't abandoned all, it's a modern browser API and could do the job for you. There is an example on that page, that you could use almost of the box.

This is the part you would need to work with:

// modify this to check if `mutation.attributeName` === `readonly`
if (mutation.type === 'attributes') {
    console.log('The ' + mutation.attributeName + ' attribute was modified.');
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda