JSFiddle - React, Tailwind, and code Playground
by Soviut
HTML
<div class="container">
<form>
<input type="text" placeholder="enter a number" />
<button>Update</button>
</form>
<ul class="result">
<li>somet</li>
<li>hing</li>
</ul>
</div>
CSS
* {
box-sizing: border-box;
}
body {
font-family: arial, helvetica, san-serif;
}
.container {
width: 80%;
margin: 0 auto;
}
form {
background: grey;
padding: 10px;
margin-bottom: 5px;
overflow: hidden;
border-radius: 5px;
}
form input[type=text] {
display: block;
width: 100%;
padding: 5px;
margin-bottom: 10px;
font-size: 1.2em;
}
form button {
display: block;
width: 150px;
padding: 5px;
float: right;
background: lightgrey;
border: 0;
border-radius: 5px;
color: black;
font-size: 1.2em;
}
.result {
padding: 10px;
background: salmon;
border-radius: 5px;
}
ul {
list-style: none outside;
}
ul li {
padding: 5px;
background: lightsalmon;
}
ul li + * {
margin-top: 5px;
}
JavaScript
var input = $('input[type=text]');
var result = $('.result');
$('form').on('submit', function(e) {
e.preventDefault();
});