How do I clean up output content on the web using Firebug?

I am debugging a JavaScript program using Firebug. In JavaScript code, it is easy to clear the JavaScript code by clicking Clear.

Now, how do I clear the output content on a website using Firebug?

Website output and Command Line code

+3


source to share


2 answers


Besides refreshing the browser every time you can run it on the console.

document.body.innerHTML = '';

      



Or, while you are experimenting, you can extend the document object for convenience ...

document.clear = function () { document.body.innerHTML = ''; }
// usage
document.clear();

      

+1


source


Alternatively, you can run this in Command Prompt / Command Editor clean up website:

document.body.innerHTML = "";

      



Or you can remove the output element from the HTML panel :

  • Right click on the output on the page and select Inspect Element with Firebug, or go to the HTML pane and select it there.

  • Press Delon your keyboard or right-click an item and select "Delete Item" from the context menu.

0


source







All Articles