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

226
Visualizações
Can't I edit JS from DevTools if it was written in an HTML file with a script tag? How to edit it?

Suppose that I'm trying to change the "test" string that it doesn't appear on the console.

<body>
    <script>
        document.addEventListener("DOMContentLoaded", () =>{
            console.log("test");
        }
    </script>
</body>

I was trying to edit the Javascript code from DevTools, but I can't edit this. I googled why I couldn't edit it, and I found an answer that an HTML file can't be edit in the Sources panel.

Can't edit HTML in Chrome dev tools Sources tab

So, I was trying to delete the line "console.log("test");" from the element tab. But, the "test" string was displayed on the console.

  1. Can't I edit JS from DevTools if it was written in an HTML file with a script tag?

  2. If question one is true, is there any other way to edit it?

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

0

The Answer is no. The only way is to run the whole function in the console. But this is all temporarily. If you want to get rid of it you have to change the html. Why are you trying to change it in the DevTools? Do you have access to the files?

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