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.
Can't I edit JS from DevTools if it was written in an HTML file with a script tag?
If question one is true, is there any other way to edit it?
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?