<form name="connectionValues">
<label for="effectiveType">effectiveType:</label>
<input type="text" name="effectiveType" value="">
<label for="rtt">rtt:</label>
<input type="text" name="rtt" value="">
<label for="downlink">downlink:</label>
<input type="text" name="downlink" value="">
<label for="saveData">saveData:</label>
<input type="text" name="saveData" value="">
</form>
*,
*:before,
*:after {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', sans-serif;
  color: #384047;
}
form {
  max-width: 300px;
  margin: 10px auto;
  padding: 10px 20px;
  background: #f4f7f8;
  border-radius: 8px;
}
input[type="text"] {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  font-size: 16px;
  height: auto;
  margin: 0;
  outline: 0;
  padding: 15px;
  width: 100%;
  background-color: #e8eeef;
  color: #8a97a0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03) inset;
  margin-bottom: 30px;
}
label {
  display: block;
  margin-bottom: 8px;
}
var connection = navigator.connection
	|| navigator.mozConnection
	|| navigator.webkitConnection;
var type = connection.type;

function updateConnectionStatus() {
  console.log(connection);
  let form = document.forms['connectionValues'];
  form.elements['effectiveType'].value = connection.effectiveType;
  form.elements['rtt'].value = connection.rtt;
  form.elements['downlink'].value = connection.downlink;
  form.elements['saveData'].value = connection.saveData;
}

connection.addEventListener('change', updateConnectionStatus);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.