0

I am working on a website in which I want to hide rectangular footer 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 ––>
</div>
john
  • 11,311
  • 40
  • 131
  • 251
  • Possible duplicate of [Show/hide 'div' using JavaScript](https://stackoverflow.com/questions/21070101/show-hide-div-using-javascript) – oezguensi Nov 06 '18 at 03:49

1 Answers1

1

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.

oezguensi
  • 930
  • 1
  • 12
  • 23