JSFiddle - React, Tailwind, and code Playground

by techiedelight

HTML

<div id="container">
  <label for="name">Name:</label>
  <input type="text" id="name">
</div>
<button id="submit">Get Value</button>

CSS

label {
  font: 15px 'Exo 2', sans-serif;
}

input {
  margin: 6px;
}

button {
  margin-top: 10px;
  padding: 3px;
  font: 15px 'Exo 2', sans-serif;
}

JavaScript

document.getElementById('submit').onclick = function() {
  var value = document.getElementById('name').value;
  alert(value);
}