Skip to content

Commit

Permalink
toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Jul 29, 2023
1 parent 9d13fd1 commit dcb36a5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions book/articles/toggle-tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
}
}
});
const r_button = document.querySelector('#toggleRCodeButton');
const python_button = document.querySelector('#togglePythonCodeButton');
r_button.style.backgroundColor = 'lightgray';
python_button.style.backgroundColor = 'white';
};

function toggle_python() {
Expand Down Expand Up @@ -69,6 +73,10 @@
}
}
});
const r_button = document.querySelector('#toggleRCodeButton');
const python_button = document.querySelector('#togglePythonCodeButton');
r_button.style.backgroundColor = 'white';
python_button.style.backgroundColor = 'lightgray';
};

window.document.addEventListener("DOMContentLoaded", function (event) {
Expand All @@ -82,6 +90,7 @@

const r_button = document.createElement('button');
r_button.id = 'toggleRCodeButton';
r_button.style.backgroundColor = 'lightgray';
r_button.textContent = 'R';
r_button.style.width = '80px';
r_button.addEventListener('click', toggle_r);
Expand Down

0 comments on commit dcb36a5

Please sign in to comment.