How to hide footer panel in edit mode in Javascript?

4177 views javascript

I am working on a website in which I want to hide rectangular panel showing at the bottom of a website.

It should work in a way when the website comes in edit mode, the rectangular panel should be hidden and when it comes in non edit mode, the rectangular panel should be visible.

The JS code for which is being called when the section comes in edit mode is:

toggleEdit: function(position) {
const self = this;
if (name == undef) {
return self;
self[name.dataset.edit != position ? "doEdit" : "undoEdit"](position);
return self;

The website comes in the edit mode when the value of position is either "hello" or "world".

Problem Statement:

I am wondering what Javascript I need to add above so that when the value of position is either "hello" or "world", it should the hide everything displayed through the following html (which is actually a footer panel):

<div class="hide-bar">
<!–– and the comment closes with ––>

answered question

1 Answer


Basically, you have to manipulate the DOM. The answer to your question, is really well explained at this question: Show/hide 'div' using JavaScript. Here, the answer provides a way to do it by using JavaScript.

If you want to do it by using a framework or library such as ReactJS you have to tell, what technology you are using.

posted this

Have an answer?


Please login first before posting an answer.