Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<div class="toast toast-success" id='status-color'>
  <button class="btn btn-clear float-right" id='start-stop-button'>START!</button>
  <span id='status-text'>Retrieving status...</span>
// где-то в фетче статуса

var statusToastEl = document.getElementById('status-color');
var statusTextEl = document.getElementById('status-text');
var runButtonEl = document.getElementById('start-stop-button');

if(!running) {
  statusToastEl.className = 'toast toast-error';
  statusTextEl.innerHTML = 'NOT RUNNING'; = 'block'; // показываем кнопку
} else {
  statusToastEl.className = 'toast toast-success';
  statusTextEl.innerHTML = 'RUNNING'; = 'none'; // прячем кнопку
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment