jacobinathanialpeterson commited on
Commit
ad43143
1 Parent(s): dc704e3

Update static/script.js

Browse files
Files changed (1) hide show
  1. static/script.js +3 -2
static/script.js CHANGED
@@ -56,7 +56,8 @@ function getMessages(roomId=myRoomId, url="https://jacobinathanialpeterson-chatb
56
  .then(data => {
57
  if (data.message) {
58
  // Get the button element you want to preserve
59
- const preserveButton = document.getElementById('createRoom');
 
60
 
61
  // Get the parent element containing all the elements you want to remove
62
  const parentElement = document.body; // Change this selector according to your DOM structure
@@ -67,7 +68,7 @@ function getMessages(roomId=myRoomId, url="https://jacobinathanialpeterson-chatb
67
  // Loop through the children and remove elements that are not the preserveButton
68
  for (let i = 0; i < children.length; i++) {
69
  const element = children[i];
70
- if (element !== preserveButton) {
71
  element.remove(); // Remove the element from the DOM
72
  }
73
  }
 
56
  .then(data => {
57
  if (data.message) {
58
  // Get the button element you want to preserve
59
+ const preserveButton1 = document.getElementById('createRoom');
60
+ const preserveButton2 = document.getElementById('joinRoom');
61
 
62
  // Get the parent element containing all the elements you want to remove
63
  const parentElement = document.body; // Change this selector according to your DOM structure
 
68
  // Loop through the children and remove elements that are not the preserveButton
69
  for (let i = 0; i < children.length; i++) {
70
  const element = children[i];
71
+ if (element !== preserveButton1 || element !== preserveButton2) {
72
  element.remove(); // Remove the element from the DOM
73
  }
74
  }