JSFiddle - React, Tailwind, and code Playground
HTML
<div>
<a href="" id="one"></a>
<span id="count">0</span>
<a href="" id="two"></a>
</div>
CSS
div{
position: relative;
border: 1px solid green;
width: 80px;
margin: 100px auto;
text-align: center;
border-radius: 20px;
overflow: hidden;
}
a{
position: relative;
background-color: green;
display: block;
width: 20px;
height: 20px;
box-shadow: inset 0px 1px 1px white;
}
#one {
float: left;
border-radius: 10px 0px 0px 10px;
}
#two {
float: right;
border-radius: 0px 10px 10px 0px;
}
#one:before {
position: absolute;
content: "";
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
border-right: 7px solid white;
left: 6px;
top: 3px;
}
#one:after {
position: absolute;
content: "";
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
border-right: 7px solid green;
left: 8px;
top: 3px;
}
#two:before {
position: absolute;
content: "";
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
border-left: 7px solid white;
right: 6px;
top: 3px;
}
#two:after {
position: absolute;
content: "";
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
border-left: 7px solid green;
right: 8px;
top: 3px;
}
JavaScript
var i = 0;
var count = document.getElementById("count");
document.getElementById("one").onclick = function() {
i--;
if (i < 0) {i = 0};
count.innerHTML = i;
return false;
};
document.getElementById("two").onclick = function() {
i++;
count.innerHTML = i;
return false;
};