built-in alert box

        
  alert('An exception occurred.');
  event.target.nextElementSibling.textContent = 'The application has just got an exception.';
        
      

Simple Popup alternative

        
  var alertBox = simplePopup(0, 'An exception occurred.');
  $.when(alertBox).then(function() {
    $(event.target).next().text('The application has just got an exception.');
  });
        
      

built-in confirm box

        
  var res = confirm('It\'s time to change. Do you agree with me?');
  if (res) {
    event.target.nextElementSibling.textContent = 'Yes, let\'s go for it.';
  } else {
    event.target.nextElementSibling.textContent = 'No, this is not the time.';
  }
        
      

Simple Popup alternative

        
  var confirmBox = simplePopup(1, 'It\'s time to change. Do you agree with me?');
  $.when(confirmBox).then(function(res) {
    if (res) {
      $(event.target).next().text('Yes, let\'s go for it.');
    } else {
      $(event.target).next().text('No, this is not the time.');
    }
  });
        
      

built-in prompt box

        
  var username = prompt('Please enter your username', 'Michael Jordan');
  if (username != null && username != '') {
    event.target.nextElementSibling.textContent = username + ', hey, welcome back.';
  }
        
      

Simple Popup alternative

        
  var promptBox = simplePopup(2, 'Please enter your username', 'Michael Jordan');
  $.when(promptBox).then(function(res) {
    if (res) {
      $(event.target).next().text(res + ', hey, welcome back.');
    } else {
      $(event.target).next().text('Anoymous user logs in.');
    }
  });