Question: I have create this toggle menu for mobile device using javascript but this is not working

```js
const selectElement = (s) => document.querySelector(s);
selectElement(s: '.open').addEventListener('click', () => {
    selectElement(s:'nav-list').classList.add('active');
});
selectElement(s:'.close').addEventListener('click', () => {
    selectElement(s:'nav-list').classList.remove(tokens:'active');
});

```

Answer: 
I followed the same tutorial, here's what I did to make it work:

Here's the ModifiedTensorBoard Class:

```
class ModifiedTensorBoard(TensorBoard):

    # Overriding init to set initial step and writer (we want one log file for all .fit() calls)
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.step = 1
        self.writer = tf.summary.create_file_writer(self.log_dir)
        self._log_write_dir = os.path.join(self.log_dir, MODEL_NAME)

    # Overriding this method to stop creating default log writer
    def set_model(self, model):
        pass

    # Overrided, saves logs with our step number
    # (otherwise every .fit() will start writing from 0th step)
    def on_epoch_end(self, epoch, logs=None):
        self.update_stats(**logs)

    # Overrided
    # We train for one batch only, no need to save anything at epoch end
    def on_batch_end(self, batch, logs=None):
        pass

    # Overrided, so won't close writer
    def on_train_end(self, _):
        pass

    def on_train_batch_end(self, batch, logs=None):
        pass

    # Custom method for saving own metrics
    # Creates writer, writes custom metrics and closes writer
    def update_stats(self, **stats):
        self._write_logs(stats, self.step)

    def _write_logs(self, logs, index):
        with self.writer.as_default():
            for name, value in logs.items():
                tf.summary.scalar(name, value, step=index)
                self.step += 1
                self.writer.flush()

```
The following code will work on TensorFlow 2.4.1 :

```
class ModifiedTensorBoard(TensorBoard):     

def __init__(self, **kwargs):
    super().__init__(**kwargs)
    self.step = 1
    self.writer = tf.summary.create_file_writer(self.log_dir)
    self._log_write_dir = self.log_dir

def set_model(self, model):
    self.model = model

    self._train_dir = os.path.join(self._log_write_dir, 'train')
    self._train_step = self.model._train_counter

    self._val_dir = os.path.join(self._log_write_dir, 'validation')
    self._val_step = self.model._test_counter

    self._should_write_train_graph = False

def on_epoch_end(self, epoch, logs=None):
    self.update_stats(**logs)

def on_batch_end(self, batch, logs=None):
    pass

def on_train_end(self, _):
    pass

def update_stats(self, **stats):
    with self.writer.as_default():
        for key, value in stats.items():
            tf.summary.scalar(key, value, step = self.step)
            self.writer.flush()

```

Just copy and paste the above code as it is, and it should work